home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / faq / comp2306.94 / text0000.txt < prev   
Encoding:
Text File  |  1994-06-25  |  130.3 KB  |  2,910 lines

  1. Archive-name: msdos-programmer-faq/faq
  2. Comp-os-msdos-programmer-archive-name: dos-faq
  3. Posting-frequency: monthly
  4. Last-modified: 22 Jun 1994
  5.  
  6. Copyright (C) 1994  Stan Brown, Oak Road Systems.  All rights reserved.
  7. This article is not in the public domain, but it may be redistributed so
  8. long as this notice, the acknowledgments, and the information on
  9. obtaining the latest copy of this list are retained and no fee is
  10. charged.  The code fragments may be used freely; credit would be polite.
  11.  
  12.     Special note:  Maintenance on this file is minimal because I have
  13.     limited time (and, lately, limited interest) in this area.  Someone
  14.     with a more active interest in DOS programming could do the net a
  15.     great service by taking over this list; send me email if interested.
  16.  
  17.  
  18. Subject:  Table of Contents
  19.  
  20. section 0. Introduction to this article
  21.     001. What is this article? (rev: 19 Apr 1994)
  22.     002. Why is this article? (rev: 20 Mar 1994)
  23.     003. How can I search this article for a particular topic? (rev: 20
  24.          Mar 1994)
  25.     004. Who has contributed to this article?
  26.     005. Are the answers guaranteed correct and complete? (rev: 20 Mar
  27.          1994)
  28. section 1. General questions
  29.     101. Why won't my code work?
  30.     102. What is this newsgroup about? (rev: 11 Sep 1993)
  31.     103. Is comp.os.msdos.programmer just for C programmers? (rev: 20
  32.          Mar 1994)
  33.     104. What's the difference from comp.sys.ibm.pc.programmer?
  34.     105. Is comp.os.msdos.programmer available as a mailing list? (new:
  35.          2 Feb 1993)
  36.     106. What's this "netiquette"? (rev: 20 Mar 1994)
  37.     107. How can I learn more about Usenet? (new: 7 Aug 1993)
  38.     108. What other technical newsgroups should I know about? (rev: 6
  39.          Apr 1994)
  40. section 2. Compile and link
  41.     201. What the heck is "DGROUP > 64K"? (rev: 18 Apr 1993)
  42.     202. How do I fix "automatic data segment exceeds 64K" or "stack
  43.          plus data exceed 64K"?
  44.     203. Will Borland C code and Microsoft C code link together? (rev:
  45.          15 Aug 1993)
  46.     204. Why did my program bomb at run time with "floating point
  47.          formats not linked" or "floating point not loaded"? (rev: 20
  48.          March 1994)
  49.     205. How can I change the stack size in Borland's C compilers? (rev:
  50.          24 March 1994)
  51.     206. What's the format of an .OBJ file? (rev: 24 Mar 1994)
  52.     207. What's the format of an .EXE header?
  53.     208. What's the difference between .COM and .EXE formats?
  54. section 3. Keyboard
  55.     301. How can I read a character without echoing it to the screen,
  56.          and without waiting for the user to press the Enter key?
  57.     302. How can I find out whether a character has been typed, without
  58.          waiting for one?
  59.     303. How can I disable Ctrl-C/Ctrl-Break and/or Ctrl-Alt-Del? (rev:
  60.          11 Sep 1993)
  61.     304. How can I disable the print screen function?
  62.     305. How can my program turn NumLock (CapsLock, ScrollLock) on or
  63.          off?
  64.     306. How can I speed up the keyboard's auto-repeat? (rev: 24 Mar
  65.          1994)
  66.     307. What is the SysRq key for?
  67.     308. How can my program tell what kind of keyboard is on the system?
  68.     309. How can I tell if input, output, or stderr has been redirected?
  69.          (rev: 24 Mar 1994)
  70.     310. How can I increase the size of the keyboard buffer? (new: 20
  71.          June 1993)
  72.     311. How can I stuff characters into the keyboard buffer? (new: 15
  73.          Aug 1993)
  74. section 4. Disks and files
  75.     401. What drive was the PC booted from?
  76.     402. How can I boot from drive b:? (rev: 24 Mar 1994)
  77.     403. Which real and virtual disk drives are valid? (rev: 15 Aug
  78.          1993)
  79.     404. How can I make my single floppy drive both a: and b:?
  80.     405. How can I disable access to a drive? (new: 15 Aug 1993)
  81.     406. How can a batch file test existence of a directory? (rev: 28
  82.          May 1994)
  83.     407. Why won't my C program open a file with a path?
  84.     408. How can I redirect printer output to a file? (rev: 16 Aug 1993)
  85.     409. How can I redirect the output of a batch file? (rev: 24 Mar
  86.          1994)
  87.     410. How can I redirect stderr? (rev: 24 Mar 1994)
  88.     411. How can my program open more files than DOS's limit of 20?
  89.          (rev: 12 Sep 1993)
  90.     412. How can I read, create, change, or delete the volume label?
  91.     413. How can I get the disk serial number? (rev: 6 Jun 1994)
  92.     414. What's the format of .OBJ, .EXE., .COM files?
  93.     415. How can I flush the software disk cache?
  94. section 5. Serial ports (COM ports)
  95.     501. How do I set my machine up to use COM3 and COM4?
  96.     502. How do I find the I/O address of a COM port? (rev: 24 Mar 1994)
  97.     503. But aren't the COM ports always at I/O addresses 3F8, 2F8, 3E8,
  98.          and 2E8?
  99.     504. How do I configure a COM port and use it to transmit data?
  100.          (rev: 17 Sep 1993)
  101. section 6. Other hardware questions and problems
  102.     601. Which 80x86 CPU is running my program? (rev: 24 Mar 1994)
  103.     602. How can a C program send control codes to my printer?
  104.     603. How can I redirect printer output to a file?
  105.     604. Which video adapter is installed?
  106.     605. How do I switch to 43- or 50-line mode?
  107.     606. How can I find the Microsoft mouse position and button status?
  108.     607. How can I access a specific address in the PC's memory? (rev: 6
  109.          Jun 1994)
  110.     608. How can I read or write my PC's CMOS memory? (rev: 24 Mar 1994)
  111.     609. How can I access memory beyond 640K? (rev: 24 Mar 1994)
  112. section 7. Other software questions and problems
  113.     701. How can a program reboot my PC? (rev: 24 Mar 1994)
  114.     702. How can I time events with finer resolution than the system
  115.          clock's 55 ms (about 18 ticks a second)? (rev: 24 Mar 1994)
  116.     703. How can I find the error level of the previous program? (rev:
  117.          24 Mar 1994)
  118.     704. How can a program set DOS environment variables? (rev: 24 Mar
  119.          1994)
  120.     705. How can I change the switch character to - from /? (rev: 20 Mar
  121.          1994)
  122.     706. How can I write a TSR (terminate-stay-resident utility)? (rev:
  123.          24 Mar 1994)
  124.     707. Why does my interrupt function behave strangely? (rev: 24 Sep
  125.          1993)
  126.     708. How can I write a device driver?
  127.     709. What can I use to manage versions of software? (rev: 21 Aug
  128.          1993)
  129.     710. What's this "null pointer assignment" after my C program
  130.          executes? (rev: 20 Mar 1994)
  131.     711. How can a batch file tell whether it's being run in a DOS box
  132.          under Windows? (new: 20 Mar 1994)
  133.     712. How can my program tell if it's running under Windows? (rev: 20
  134.          Mar 1994)
  135.     713. How can a program tell whether ANSI.SYS is installed? (new: 20
  136.          Apr 1994)
  137.     799. How do I copyright software that I write? (rev: 9 Sep 1993)
  138. section A. Downloading
  139.     A01. What are SimTel, Garbo, and wustl? (rev: 6 Apr 1994)
  140.     A02. I have no ftp access.  How can I get files from the archives?
  141.          (rev: 14 June 1993)
  142.     A03. Can I get archives on CD-ROM? (rev: 24 May 1993)
  143.     A04. Where do I find program <mumble>? (rev: 7 Aug 1993)
  144.     A05. How can I check SimTel or Garbo before I post a request for a
  145.          program? (rev: 24 Mar 1994)
  146.     A06. How do I download and decode a program I found? (rev: 7 Aug
  147.          1993)
  148.     A07. Where is UUDECODE?
  149.     A08. Why do I get errors when extracting from a ZIP file I
  150.          downloaded? (rev: 20 Mar 1994)
  151. section B. Vendors and products
  152.     B01. How can I contact Borland? (rev: 6 Sep 1993)
  153.     B02. How can I contact Microsoft? (rev: 18 Sep 1993)
  154.     B03. What's the current version of UNZIP? (rev: 17 Mar 1994)
  155.     B04. What is the phone number for a vendor's BBS? (rev: 24 Mar 1994)
  156. section C. More information
  157.     C01. Are there any good on-line references for PC hardware
  158.          components? (rev: 28 July 1993)
  159.     C02. Are there any good on-line references for PC interrupts?
  160.     C03. What and where is "Ralf Brown's interrupt list"? (rev: 6 Jun
  161.          1994)
  162.     C04. Where can I find lex, yacc, and language grammars?
  163.     C05. What's the best book to learn programming?
  164.     C06. Where are FAQ lists archived? (rev: 29 Mar 1994)
  165.     C07. Where can I get the latest copy of this FAQ list? (rev: 30 Mar
  166.          1994)
  167.     C08. How do I use ftp? (rev: 6 Apr 1994)
  168.  
  169.  
  170. section 0. Introduction to this article
  171. =======================================
  172.  
  173. Subject:  001. What is this article? (rev: 19 Apr 1994)
  174.  
  175.     This is the FAQ list (Frequently Asked Questions list) for the
  176.     newsgroup comp.os.msdos.programmer.  Starting 2 Feb 1993, new
  177.     questions and questions with revised answers are marked with "new:"
  178.     or "rev:" and the change date.  A separate article, containing just
  179.     the changes, is posted with subject line "comp.os.msdos.programmer
  180.     FAQ diffs".
  181.  
  182.     If the posting date shown above is much more than a month in the
  183.     past, see "C07. Where can I get the latest copy of this FAQ list?"
  184.  
  185. Subject:  002. Why is this article? (rev: 20 Mar 1994)
  186.  
  187.     FAQ lists are intended to reduce the noise level in their newsgroups
  188.     that results from the repetition of the same questions, correct
  189.     answers, wrong answers, corrections to the wrong answers,
  190.     corrections to the corrections, debate, etc.
  191.  
  192.     This list should serve as a repository of the canonical "best"
  193.     answers to the questions in it.  The names of folks who have helped
  194.     to improve this FAQ list are listed in "004. Who has contributed to
  195.     this article?"
  196.  
  197. Subject:  003. How can I search this article for a particular topic?
  198.                (rev: 20 Mar 1994)
  199.  
  200.     This list is in digest format.
  201.  
  202.     To skip one topic and go to the next:  Search for "Subject" starting
  203.     in column 1.  In trn and similar newsreaders, the command
  204.     "g^Subject", or a simple Ctrl-G, does that.
  205.  
  206.     To search for specific topics:  In the Table of Contents (above),
  207.     locate the question you need.  Then search for that question number.
  208.     For example, while you're reading this list, the trn newsreader
  209.     command "g  203" (note the two spaces) goes to question 203.
  210.  
  211.     If your newsreader doesn't support searches, you can extract these
  212.     articles to a file and use your favorite editor's search commands.
  213.  
  214. Subject:  004. Who has contributed to this article?
  215.  
  216.     This list is edited by Stan Brown, Oak Road Systems, Cleveland,
  217.     Ohio, the "I" or "me" in some answers.
  218.  
  219.     Many articles posted in comp.os.msdos.programmer sparked ideas or
  220.     provided information for the first version of this list.  Though
  221.     they are not responsible for any errors, thanks are due to the
  222.     following persons for posted articles or private email that led to
  223.     improvements in this FAQ list:
  224.  
  225.     Jamshid Afshar, Mark Aitchison, Sanjay Aiyagari, George Almasi,
  226.     Aaron Auseth, Robert Baker, Preston Bannister, Scott Barman, Denis
  227.     Beauregard, Per Bergland, Mike Black, Chris Blum, Ron Bodkin, Mark
  228.     Brader, Jon Brinkmann, Andrew James Bromage, Glynn Brooks, Paul
  229.     Brooks, Ralf Brown, Shaun Burnett, D'Arcy J.M. Cain, Raymond Chen,
  230.     Denny de Jonge, Eric DeVolder, Alan Drew, Paul Ducklin, Gary Dueck,
  231.     Roland Eriksson, Mark Evans, Markus Fischer, George Forsman, Roger
  232.     Fulton, Vincent Giovannone, Robert Grunloh, B.Haible, Janos Haide,
  233.     Klaus Hartnegg, Kris Heidenstrom, Tom Haapanen, Joel Hoffman, Ari
  234.     Hovila, Chin Huang, Joe Huffman, Michael Holin, Mike Iarrobino,
  235.     Byrial Jensen, Rune Jorgensen, Ajay Kamdar, Everett Kaser, Jeff
  236.     Kellam, Jen Kilmer, Reinhard Kirchner, Dave Kirsch, Chad Knudsen,
  237.     Samuel Ko, Janne Kukonlehto, Benjamin Lee, Stephen Lee, Jim Lynch,
  238.     Greg Malknecht, Sidney Markowitz, Jim Marks, Dimitri Matzarakis,
  239.     Fred McCall, Ken McKee, Doug Merrett, Tom Milner, Bill Moore, Duncan
  240.     Murdoch, Steve Murphy, Daniel Neri, Mert Nickerson, David Nugent,
  241.     John Oldenburg, David Pape, Keith Petersen, Karl Riedling, Arthur
  242.     Rubin, Gerald Ruderman, Timo Salmi, Tapio Sand, John Schmid, Russell
  243.     Schulz, Huseyin Sevay, Ajay Shah, Bob Smith, Sean Sullivan, Steve
  244.     Summit, Tom Swingle, Anders Thulin, Curt Tilmes, Rick Watkins,
  245.     Ya-Gui Wei, Joe Wells, Scott Winder, Gregory Youngblood,
  246.     khill@vax1.umkc.edu
  247.  
  248.     New contributor: D'Arcy J.M. Cain, Janne Kukonlehto, Sean Sullivan
  249.  
  250. Subject:  005. Are the answers guaranteed correct and complete? (rev: 20
  251.                Mar 1994)
  252.  
  253.     I've tried to check all facts, but THERE IS NO WARRANTY ON THE CODE
  254.     OR ON THE TECHNIQUES DESCRIBED HEREIN.  Please send corrections to
  255.     brown@ncoast.org.  All the code has been tested; but the testing may
  256.     not have been perfect, and machines and configurations vary.
  257.     (Except where otherwise noted, C code was tested with both BC++ 2.0
  258.     and MSC 5.0.)
  259.  
  260.     The mention of particular books or programs must not be construed to
  261.     reflect unfavorably on any that are not mentioned.
  262.  
  263.  
  264. section 1. General questions
  265. ============================
  266.  
  267. Subject:  101. Why won't my code work?
  268.  
  269.     First you need to try to determine whether the problem is in your
  270.     use of the programming language or in your use of MS-DOS and your PC
  271.     hardware.  (Your manual should tell you which features are standard
  272.     and which are vendor- or MS-DOS- or PC-specific.  You _have_ read
  273.     your manual carefully, haven't you?)
  274.  
  275.     If the feature that seems to be working wrong is something related
  276.     to your PC hardware or to the internals of MS-DOS, this group is the
  277.     right place to ask.  (Please check this FAQ list first, to make sure
  278.     your question isn't already answered here.)
  279.  
  280.     On the other hand, if your problem is with the programming language,
  281.     the comp.lang hierarchy (including comp.lang.pascal and comp.lang.c)
  282.     is probably a better resource.  Please read the other group's FAQ
  283.     list thoroughly before posting.  (These exist in comp.lang.c,
  284.     comp.lang.c++, comp.lang.modula3, comp.lang.lisp, comp.lang.perl;
  285.     they may exist in other groups as well.)  It's almost never a good
  286.     idea to crosspost between comp.os.msdos.programmer and a language
  287.     group.
  288.  
  289.     Before posting in either place, try to make your program as small as
  290.     possible while still exhibiting the bad behavior.  Sometimes this
  291.     alone is enough to show you where the trouble is.  Also edit your
  292.     description of the problem to be as short as possible.  This makes
  293.     it look more like you tried to solve the problem on your own, and
  294.     makes people more inclined to try to help you.  See also "106.
  295.     What's this "netiquette"?"
  296.  
  297. Subject:  102. What is this newsgroup about? (rev: 11 Sep 1993)
  298.  
  299.     comp.os.msdos.programmer (comp.sys.ibm.pc.programmer until September
  300.     1990) concerns programming for MS-DOS systems.  The article "USENET
  301.     Readership report for Aug 93" in news.lists shows 78,000 readers of
  302.     this newsgroup worldwide.  Traffic (exclusive of crossposts) was 813
  303.     articles aggregating 1604 Kbytes.
  304.  
  305.     Much of our traffic is about language products (chiefly from Borland
  306.     and Microsoft).  More programming topics focus on C than on any one
  307.     other language, but we are not just for C programmers (see "103. Is
  308.     comp.os.msdos.programmer just for C programmers?").
  309.  
  310.     Since most MS-DOS systems run on hardware that is roughly compatible
  311.     with the IBM PC, on Intel 8088, 80188, or 80x86 chips, we tend to
  312.     get a lot of questions and answers about programming other parts of
  313.     the hardware.
  314.  
  315. Subject:  103. Is comp.os.msdos.programmer just for C programmers? (rev:
  316.                20 Mar 1994)
  317.  
  318.     No, it is for all programmers who want to share information about
  319.     programming in MS-DOS and DOS replacements like 4DOS.  Programs and
  320.     questions are also posted in Pascal, assembly, and other languages
  321.     (including MS-DOS batch programming.)
  322.  
  323.     Why does the newsgroup seem to be so C-oriented sometimes?  There
  324.     are two reasons.  First, comp.lang.c and comp.lang.pascal have
  325.     evolved in different directions.  comp.lang.pascal welcomes vendor-
  326.     specific discussion, such as Turbo Pascal.  Since so many of TP's
  327.     features are tailored to programming on PCs and in MS-DOS, Turbo
  328.     Pascal programmers tend to find DOS questions welcomed there, so
  329.     that comp.os.msdos.programmer gets less of the "DOS in Turbo Pascal"
  330.     traffic.  On the other hand, comp.lang.c has stayed closer to
  331.     talking only about the C language, and vendor-specific or operating-
  332.     system-specific questions are not welcome.  This tends to push
  333.     questions about disks, DOS file structure, video, the keyboard,
  334.     TSRs, etc. to comp.os.msdos.programmer even when those programs are
  335.     written in C.
  336.  
  337.     This FAQ is definitely C-oriented, not because that's necessarily
  338.     best but because I tried to stick to what I could verify personally.
  339.     As a C programmer (with some assembler), I could most carefully
  340.     verify solutions in C or assembler.  I felt that short, clear
  341.     programs could be published in just one language and programmers
  342.     could translate them into their languages of choice.  But the FAQ
  343.     list also contains several long programs written only in C; this is
  344.     a defect with no obvious remedy.  Most answers that point to source
  345.     code at archive sites include both C- and Pascal-language source
  346.     when available.
  347.  
  348. Subject:  104. What's the difference from comp.sys.ibm.pc.programmer?
  349.  
  350.     c.s.i.p.programmer is the old name of comp.os.msdos.programmer, and
  351.     has been obsolete since September 1990.  However, many systems have
  352.     not removed the old group, or have removed it but aliased it to the
  353.     new name.  This means that some people still think they're posting
  354.     to c.s.i.p.programmer even though they're actually posting to
  355.     comp.os.msdos.programmer.
  356.  
  357.     You can easily verify the non-existence of c.s.i.p.programmer by
  358.     reference to the "List of Active Newsgroups" posted to news.groups.
  359.     It's available as /pub/usenet/news.answers/active-newsgroups/part1
  360.     from the archives (see "C06. Where are FAQ lists archived?").
  361.  
  362. Subject:  105. Is comp.os.msdos.programmer available as a mailing list?
  363.                (new: 2 Feb 1993)
  364.  
  365.     Sorry, no.
  366.  
  367. Subject:  106. What's this "netiquette"? (rev: 20 Mar 1994)
  368.  
  369.     Netiquette is good Usenet etiquette.  It includes basic rules like
  370.     the ones below.  (See also "107. How can I learn more about
  371.     Usenet?")
  372.  
  373.     - Always read a newsgroup for a reasonable time before you post an
  374.       article to it.
  375.  
  376.     - Pick the one right group for your article; don't crosspost unless
  377.       absolutely necessary.  If you absolutely must post an article to
  378.       more than one group, do crosspost it and don't post the same
  379.       article separately to each group.  See "108. What other technical
  380.       newsgroups should I know about?" when considering where to post an
  381.       article.
  382.  
  383.     - Before you post a question, make sure you're posting to the right
  384.       newsgroup; the best way to do that is to observe the preceding
  385.       rule.  Check the group's FAQ list (if it has one) to make sure
  386.       that your question isn't already answered there; see "C06. Where
  387.       are FAQ lists archived?".
  388.  
  389.     - When you post a question, if you ask for email responses then
  390.       promise to post a summary.  Keep your promise.  And make it a real
  391.       summary: don't just append all the email you got.  Instead, write
  392.       your own (brief) description of the solution:  this is the best
  393.       way to make sure you really understand it.
  394.  
  395.     - Before you post a follow-up, read the other follow-ups.  Very
  396.       often you'll find that someone else has already made the point you
  397.       had in mind.
  398.  
  399.     - When someone posts a question, if you want to know the answer
  400.       don't post a "me, too".  Instead send email to the poster asking
  401.       him or her to share responses with you.
  402.  
  403.     - When posting a follow-up to another posted article, remove all
  404.       headers and signature lines from the old article; just keep the
  405.       line "In <article>, so-and-so writes:".  Also cut the original
  406.       article down as much as possible; just keep enough of it to remind
  407.       readers of the context.
  408.  
  409.     - Keep lines in posted articles to 72-75 characters.  Many
  410.       newsreaders chop off column 81 or arbitrarily insert a newline
  411.       there, which makes longer lines difficult or impossible to read.
  412.       But you need to keep well below 80 characters per line to allow
  413.       for the > characters that get inserted when other people post
  414.       follow-ups to your article.
  415.  
  416.     - Keep your signature to 4 lines or less (including any graphics),
  417.       and for heaven's sake make sure it doesn't get posted twice in
  418.       your article.
  419.  
  420.     - Don't post email without first obtaining the permission of the
  421.       sender.
  422.  
  423. Subject:  107. How can I learn more about Usenet? (new: 7 Aug 1993)
  424.  
  425.     There are two important newsgroups for learning about how Usenet and
  426.     newsreader software works:
  427.  
  428.     - news.announce.newusers contains periodic postings that everybody
  429.       is asked to read before posting anything to Usenet.  (In theory,
  430.       all new users are subscribed to news.announce.newusers
  431.       automatically.  But in practice not all newsreader software does
  432.       that, so that many people violate the guidelines given there
  433.       simply because they don't know about them.)
  434.  
  435.     - news.newusers.questions is described as "Q & A for users new to
  436.       the Usenet".  But new and long-time users can ask or answer
  437.       questions about Usenet and newsreader software there.  There's an
  438.       important article, "Welcome to news.newusers.questions! (weekly
  439.       posting)", that everyone is asked to read before posting to
  440.       news.newusers.questions.  (See below for ways to get a copy of
  441.       that article.)
  442.  
  443.     The following postings in news.announce.newusers might be considered
  444.     the "mandatory course" for new users:
  445.  
  446.         Introduction to news.announce.newusers
  447.         What is Usenet?
  448.         Answers to Frequently Asked Questions
  449.         Rules for posting to Usenet
  450.         A Primer on How to Work With the Usenet Community
  451.         Hints on writing style for Usenet
  452.         Emily Postnews Answers Your Questions on Netiquette
  453.  
  454.     The articles mentioned above are downloadable via ftp from
  455.     rtfm.mit.edu in the following files:
  456.  
  457.         /pub/usenet/news.answers/news-newusers-intro
  458.             Welcome to news.newusers.questions! (weekly posting)
  459.         /pub/usenet/news.answers/news-announce-intro/part1
  460.             Introduction to news.announce.newusers
  461.         /pub/usenet/news.answers/what-is-usenet/part1
  462.             What is Usenet?
  463.         /pub/usenet/news.answers/usenet-faq/part1
  464.             Answers to Frequently Asked Questions
  465.         /pub/usenet/news.answers/posting-rules/part1
  466.             Rules for posting to Usenet
  467.         /pub/usenet/news.answers/usenet-primer/part1
  468.             A Primer on How to Work With the Usenet Community
  469.         /pub/usenet/news.answers/usenet-writing-style/part1
  470.             Hints on writing style for Usenet
  471.         /pub/usenet/news.answers/emily-postnews/part1
  472.             Emily Postnews Answers Your Questions on Netiquette
  473.  
  474.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  475.     archived?"
  476.  
  477. Subject:  108. What other technical newsgroups should I know about?
  478.                (rev: 6 Apr 1994)
  479.  
  480.     Caution:  Some of these newsgroups have specialized charters; you'll
  481.     probably get flamed (and deserve it) if you post to an inappropriate
  482.     group.  Most groups have FAQ lists that will tell you what's
  483.     appropriate.  Don't post a request for the FAQ list; instead,
  484.     retrieve it yourself: see "C06. Where are FAQ lists archived?"
  485.  
  486.     - misc.forsale.computers.d and misc.forsale.computers.pc-clone are
  487.       where you post notices of equipment, software, or computer books
  488.       that you want to sell.  Please don't post or crosspost those
  489.       notices to comp.os.msdos.programmer.
  490.  
  491.     - comp.os.ms-windows.programmer.* groups (formerly part of
  492.       comp.windows.ms.programmer):  Similar to comp.os.msdos.programmer,
  493.       but focus on programming for the MS-Windows platform.
  494.  
  495.     - comp.sys.ibm.pc.hardware is for more hardware-oriented discussions
  496.       of the machines that run DOS.
  497.  
  498.     - the various comp.lang.* groups for articles and questions on the
  499.       programming languages.  Caution:  some groups welcome discussions
  500.       that are operating-system dependent or vendor specific; others do
  501.       not.  For example, comp.lang.c is definitely _not_ for questions
  502.       about programming DOS or PC system features, even if the programs
  503.       are written in C.  On the other hand, comp.lang.pascal contains
  504.       much discussion that is specific to Turbo Pascal.
  505.  
  506.     - comp.binaries.ibm.pc.wanted: AFTER you have looked in the other
  507.       groups, this is the place to post a request for a particular
  508.       binary program.
  509.  
  510.     - comp.archives.msdos.announce (moderated) explains how to use the
  511.       archive sites, especially Garbo and SimTel, and lists files
  512.       uploaded to them.  Discussions belong in comp.archives.msdos.d,
  513.       which replaced comp.binaries.ibm.pc.archives in December 1992.
  514.  
  515.     - MSDOS-Ann mailing list, for those who cannot subscribe to the
  516.       comp.archives.msdos.announce newsgroup, lists SimTel and Garbo
  517.       uploads in digest format.  Instructions are downloadable as
  518.  
  519.         /pc/MSDOSANN.ZIP from Garbo
  520.         /pub/msdos/info/msdosann.zip from SimTel.
  521.  
  522.     - comp.binaries.ibm.pc.d is for discussions about programs posted in
  523.       comp.binaries.ibm.pc, and only those programs.  This is a good
  524.       place to report bugs in the programs, but not to ask where to find
  525.       them (see cbip.wanted, above).  cbip.d is NOT supposed to be a
  526.       general PC discussion group.
  527.  
  528.     - comp.sources.misc: a moderated group for source code for many
  529.       computer systems.  It tends to get lots of Unix stuff, but you may
  530.       also pick up some DOS-compatible code here.
  531.  
  532.     - alt.sources: an unmoderated group for source code.  Guidelines are
  533.       posted periodically.
  534.  
  535.     - comp.os.msdos.programmer.turbovision is specifically for
  536.       programming in Turbo Vision.
  537.  
  538.  
  539. section 2. Compile and link
  540. ===========================
  541.  
  542. Subject:  201. What the heck is "DGROUP > 64K"? (rev: 18 Apr 1993)
  543.  
  544.     This Q explains the problem; the next Q gives some remedies.
  545.  
  546.     DGROUP is a link-time group of data segments, and the compiler
  547.     typically generates code that expects DS to be pointing to DGROUP.
  548.     (Exception:  Borland's huge model has no DGROUP.)
  549.  
  550.     Here's what goes into DGROUP:
  551.  
  552.     - tiny model (all pointers near):  DGROUP holds the entire program.
  553.  
  554.     - small and medium models (data pointers near):  DGROUP holds all
  555.       globals and static variables including string literals, plus the
  556.       stack and the heap.
  557.  
  558.     - large, compact, and huge models in Microsoft (data pointers far):
  559.       DGROUP holds only initialized globals and static variables
  560.       including string literals, plus the stack and the near heap.
  561.  
  562.     - large and compact models in Borland (data pointers far): DGROUP
  563.       holds initialized and uninitialized globals and static variables
  564.       including string literals, but not the stack or heap.
  565.  
  566.     - huge model in Borland (data pointers far): there is no DGROUP, so
  567.       the 64K limit doesn't apply.
  568.  
  569.     In all of the above, which is to say all six models in Microsoft C
  570.     and all but huge in Borland C, DGROUP is limited to 64K including
  571.     string literals (which are treated as static data).  This limitation
  572.     is due to the Intel CPU's segmented architecture.
  573.  
  574.     For more information, see topics like "memory models" and "memory
  575.     management" in the index of your compiler manual.  Also see
  576.     TI738.asc, downloadable as part of
  577.  
  578.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  579.         /pc/turbopas/bchelp10.zip at Garbo,
  580.  
  581.     for an extended general discussion of memory usage in Borland C
  582.     programs, of which much applies to any C compiler in DOS.
  583.  
  584. Subject:  202. How do I fix "automatic data segment exceeds 64K" or
  585.                "stack plus data exceed 64K"?
  586.  
  587.     These messages are a variation of "DGROUP > 64K".  For causes,
  588.     please see the preceding Q.
  589.  
  590.     If you get this error in tiny model, your program is simply too big
  591.     and you must use a different memory model.  If you get this link
  592.     error in models S, C, M, L, or Microsoft's H, there are some things
  593.     you can do.  (This error can't occur in Borland's huge model.)
  594.  
  595.     If you have one or two big global arrays, simply declare them far.
  596.     The compiler takes this to mean that any references to them will use
  597.     32-bit pointers, so they'll be in separate segments and no longer
  598.     part of DGROUP.
  599.  
  600.     Or you can use the /Gt[number] option with Microsoft or -Ff[=size]
  601.     with Borland C++ 2.0 and up.  This will automatically put variables
  602.     above a certain size into their own segments outside of DGROUP.
  603.  
  604.     Yet another option is to change global arrays to far pointers.  Then
  605.     at the beginning of your program, allocate them from the far heap
  606.     (_fmalloc() in Microsoft, farmalloc() in Borland).
  607.  
  608.     Finally, you can change to huge model (with Borland compilers, not
  609.     Microsoft).  Borland's H model still uses far pointers by default,
  610.     but "sets aside the [64K] limit" and has no DGROUP group, according
  611.     to the BC++ 2.0 Programmer's Guide.  Microsoft's H model does use
  612.     huge data pointers by default but retains DGROUP and its 64K limit,
  613.     so switching to the H model doesn't buy you anything if you have
  614.     DGROUP problems.
  615.  
  616. Subject:  203. Will Borland C code and Microsoft C code link together?
  617.                (rev: 15 Aug 1993)
  618.  
  619.     Typically this question is asked by someone who owns compiler A and
  620.     is trying to write code to link with a third-party library that was
  621.     compiled under compiler B.
  622.  
  623.     The answer to the question is, Not in general.  Here are some of the
  624.     reasons:
  625.  
  626.     - "Helper" functions (undocumented functions for stack checking,
  627.       floating-point arithmetic, and operations on longs) differ between
  628.       the two compilers.
  629.  
  630.     - The compilers may embed instructions in the object code that tell
  631.       the linker to look for their own run-time libraries.  You can use
  632.       the linker option that says to ignore such instructions: /n in
  633.       TLINK, /NOD in the Microsoft linker (the one that comes with the C
  634.       compiler, not the one that used to come with DOS).  But getting
  635.       around this problem will very likely just reveal other problems,
  636.       like different helper functions, that have no easy solution.
  637.  
  638.     Those problems will generate link-time errors.  Others may not show
  639.     up until run time:
  640.  
  641.     - Borland's compact, large, and huge models don't assume DS=SS, but
  642.       Microsoft's do.  The -Fs option on the Borland compiler, or one of
  643.       the /A options on Microsoft, should take care of this problem--
  644.       once you know that's what's going on.
  645.  
  646.     - Check conventions for ordering and packing structure members, and
  647.       for alignment of various types on byte, word, paragraph, or other
  648.       boundaries.  Again, you can generally adjust your code to match if
  649.       you know what conventions were used in compiling the "foreign"
  650.       libraries.
  651.  
  652.     - Check the obvious and make sure that your code was compiled under
  653.       the same memory model as the code you're trying to link with.
  654.       (That's necessary, but no guarantee.  Microsoft and Borland don't
  655.       use exactly the same conventions for segments and groups,
  656.       particularly in the larger memory models.)
  657.  
  658.     That said, there are some circumstances where you can link hybrids.
  659.     Your best chance of success comes if you compile in large model with
  660.     the compiler switch that says to reload DS on entry to each
  661.     function, avoid longs and floating point, use only 16-bit pointers,
  662.     suppress stack checking, and specify all libraries used in the link.
  663.  
  664. Subject:  204. Why did my program bomb at run time with "floating point
  665.                formats not linked" or "floating point not loaded"? (rev:
  666.                20 March 1994)
  667.  
  668.     These messages look similar but have very different causes.
  669.  
  670.     "floating point not loaded" is Microsoft C's run-time message when
  671.     the code requires a numeric coprocessor but your computer doesn't
  672.     have one installed.  If the program is yours, relink it using the
  673.     xLIBCE or xLIBCA library (where x is the memory model).
  674.  
  675.     "floating point formats not linked" is a Borland run-time error
  676.     (Borland C or C++, Turbo C or C++).  Borland's compilers try to be
  677.     smart and not link in the floating-point (f-p) library unless you
  678.     need it.  Alas, they all get the decision wrong.  One common case is
  679.     where you don't call any f-p functions, but you have %f or other f-p
  680.     formats in scanf() or printf() calls.  The cure is to call an f-p
  681.     function, or at least force one to be present in the link.
  682.  
  683.     To do that, define this function somewhere in a source file but
  684.     don't call it:
  685.  
  686.         static void forcefloat(float *p) {
  687.             float f = *p;
  688.             forcefloat(&f);
  689.         }
  690.  
  691.     It doesn't have to be in the module with the main program, as long
  692.     as it's in a module that will be included in the link.
  693.  
  694.     If you have Borland C++ 3.0, the README file documents a slightly
  695.     less ugly work-around.  Insert these statements in your program:
  696.  
  697.         extern unsigned _floatconvert;
  698.         #pragma extref _floatconvert
  699.  
  700. Subject:  205. How can I change the stack size in Borland's C compilers?
  701.                (rev: 24 March 1994)
  702.  
  703.     In Turbo C, Turbo C++, and Borland C++, you may not find "stack
  704.     size" in the index but the global variable _stklen should be there.
  705.     The manual will instruct you to put a statement like
  706.  
  707.         extern unsigned _stklen = 54321U;
  708.  
  709.     in your code, outside of any function.  You must assign the value
  710.     right in the extern statement; it won't work to assign a value at
  711.     run time.  The linker may give you a duplicate symbol warning, which
  712.     you can ignore.
  713.  
  714. Subject:  206. What's the format of an .OBJ file? (rev: 24 Mar 1994)
  715.  
  716.     - base .OBJ format:  Intel's document number #121748-001, {8086
  717.       Relocatable Object Module Formats}.  (not verified)
  718.  
  719.     Both Microsoft and Borland have extended the .OBJ format, as has IBM
  720.     for OS/2; and according to the MS-DOS encyclopedia, Microsoft
  721.     doesn't actually use all the listed formats.
  722.  
  723.     - Microsoft-specific .OBJ formats:
  724.  
  725.       * The .OBJ format document dated 14 Dec 1992, a WinHelp file from
  726.         the Microsoft developer's CD-ROM (266K after unzipping), is
  727.         downloadable as
  728.  
  729.         /vendor/microsoft/developer-network/ctech/11-9.zip from
  730.             ftp.uu.net.
  731.  
  732.       * A 45-page article can be found in the {MS-DOS Encyclopedia},
  733.         ISBN 1-55615-049-0, now out of print.
  734.  
  735.       * "Microsoft Object Module Format (OMF)" Specification, 22 Nov
  736.         1991, was published by the Microsoft Languages Group.  (not
  737.         verified)
  738.  
  739.     - Borland-specific .OBJ formats:  Open Architecture Handbook.  The
  740.       Borland Developer's Technical Guide, 1991, no ISBN.  Chapter 2,
  741.       "Object file contents", (pages 27-50) covers the comment records
  742.       sent to the object file by Borland C++ version 3.0 and other
  743.       Borland compilers.  The comment records mostly contain information
  744.       for the Borland debugger. (not verified)
  745.  
  746.     - A "tutorial on the .OBJ format" comes with the VAL experimental
  747.       linker, downloadable as
  748.  
  749.         /pub/msdos/pgmutil/val-link.zip at SimTel
  750.         /pc/assembler/linker.zoo at Garbo.
  751.  
  752.       Despite such different names, those files have the same contents,
  753.       but their contents are dated 18 Feb 1989.  You'd be better off
  754.       with one of the more recent references listed above.
  755.  
  756. Subject:  207. What's the format of an .EXE header?
  757.  
  758.     See PC Magazine 30 June 1992 (xi:12) pages 349-350 for the old and
  759.     new formats.  For a more detailed layout, look under INT 21 AH=4B in
  760.     Ralf Brown's interrupt list (Q C03).  That list includes extensions
  761.     for Borland's TLINK and Borland debugger info.
  762.  
  763.     Among the books that detail formats of executable files are {DOS
  764.     Programmer's Reference: 2d Edition} by Terry Dettman and Jim Kyle,
  765.     ISBN 0-88022-458-4; and {Microsoft MS-DOS Programmer's Reference},
  766.     ISBN 1-55615-329-5.
  767.  
  768. Subject:  208. What's the difference between .COM and .EXE formats?
  769.  
  770.     To oversimplify:  a .COM file is a direct image of core, and an .EXE
  771.     file will undergo some further relocation when it is run (and so it
  772.     begins with a relocation header).  A .COM file is limited to 64K for
  773.     all segments combined, but an .EXE file can have as many segments as
  774.     your linker will handle and be as large as RAM can take.
  775.  
  776.     The actual file extension doesn't matter.  DOS knows that a file
  777.     being loaded is in .EXE format if its first two bytes are MZ or ZM;
  778.     otherwise it is assumed to be in .COM format.  For instance, DR-DOS
  779.     6.0's COMMAND.COM is in .EXE format.
  780.  
  781.  
  782. section 3. Keyboard
  783. ===================
  784.  
  785. Subject:  301. How can I read a character without echoing it to the
  786.                screen, and without waiting for the user to press the
  787.                Enter key?
  788.  
  789.     The C compilers from Microsoft and Borland offer getch() (or
  790.     getche() to echo the character); Turbo Pascal has ReadKey.
  791.  
  792.     In other programming languages, execute INT 21 AH=8; AL is returned
  793.     with the character from standard input (possibly redirected).  If
  794.     you don't want to allow redirection, or you want to capture Ctrl-C
  795.     and other special keys, use INT 16 AH=10; this will return the scan
  796.     code in AH and ASCII code (if possible) in AL, but  AL=E0 with AH
  797.     nonzero indicates that one of the grey "extended" keys was pressed.
  798.     (If your BIOS doesn't support the extended keyboard, use INT 16 AH=0
  799.     not 10.)
  800.  
  801. Subject:  302. How can I find out whether a character has been typed,
  802.                without waiting for one?
  803.  
  804.     In Turbo Pascal, use KeyPressed.  Both Microsoft C and Turbo C offer
  805.     the kbhit() function.  All of these tell you whether a key has been
  806.     pressed.  If no key has been pressed, they return that information
  807.     to your program.  If a keystroke is waiting, they tell your program
  808.     that but leave the key in the input buffer.
  809.  
  810.     You can use the BIOS call, INT 16 AH=01 or 11, to check whether an
  811.     actual keystroke is waiting; or the DOS call, INT 21 AH=0B, to check
  812.     for a keystroke from stdin (subject to redirection).  See Ralf
  813.     Brown's interrupt list (Q C03).
  814.  
  815. Subject:  303. How can I disable Ctrl-C/Ctrl-Break and/or Ctrl-Alt-Del?
  816.                (rev: 11 Sep 1993)
  817.  
  818.     Several utilities are downloadable from /pub/msdos/keyboard at
  819.     SimTel.  In that directory, cadel.zip contains a TSR (with source
  820.     code) to disable those keys.  Also, keykill.arc contains two
  821.     utilities:  keykill.com lets you disable up to three keys of your
  822.     choice, and deboot.com changes the boot key to leftShift-Alt-Del.
  823.  
  824.     C programmers who simply want to make sure that the user can't Ctrl-
  825.     Break out of their program can use the ANSI-standard signal()
  826.     function; the Borland compilers also offer ctrlbrk() for handling
  827.     Ctrl-Break.  However, if your program uses normal DOS input such as
  828.     getch(), ^C will appear on the screen when the user presses Ctrl-C
  829.     or Ctrl-Break.  You can avoid the ^C echo for Ctrl-C by using
  830.     _bios_keybrd() in MSC or bioskey() in BC++; however, Ctrl-Break will
  831.     still terminate the program.
  832.  
  833.     An alternative approach involves programming input at a lower level.
  834.     You can use INT 21 AH=7, which allows redirection but doesn't echo
  835.     the ^C (or any other character, for that matter); or use INT 16 AH=0
  836.     or 10; or hook INT 9 to discard Ctrl-C and Ctrl-Break before the
  837.     regular BIOS keyboard handler sees them; etc., etc.
  838.  
  839.     You should be aware that Ctrl-C and Ctrl-Break are processed quite
  840.     differently internally.  Ctrl-Break, like all keystrokes, is
  841.     processed by the BIOS code at INT 9 as soon as the user presses the
  842.     keys, even if earlier keys are still in the keyboard buffer:  by
  843.     default the handler at INT 1B is called.  Ctrl-C is not special to
  844.     the BIOS, nor is it special to DOS functions 6 and 7; it _is_
  845.     special to DOS functions 1 and 8 when at the head of the keyboard
  846.     buffer.  You will need to make sure BREAK is OFF to prevent DOS
  847.     polling the keyboard for Ctrl-C during non-keyboard operations.
  848.  
  849.     Some good general references are {Advanced MS-DOS} by Ray Duncan,
  850.     ISBN 1-55615-157-8; {8088 Assembler Language Programming:  The IBM
  851.     PC}, ISBN 0-672-22024-5, by Willen & Krantz; and {COMPUTE!'s Mapping
  852.     the IBM PC}, ISBN 0-942386-92-2.
  853.  
  854. Subject:  304. How can I disable the print screen function?
  855.  
  856.     There are really two print screen functions:  1) print current
  857.     screen snapshot, triggered by PrintScreen or Shift-PrtSc or Shift-
  858.     grey*, and 2) turn on continuous screen echo, started and stopped by
  859.     Ctrl-P or Ctrl-PrtSc.
  860.  
  861.     1) Screen snapshot to printer
  862.  
  863.     The BIOS uses INT 5 for this.  Fortunately, you don't need to mess
  864.     with that interrupt handler.  The standard handler, in BIOS versions
  865.     dated December 1982 or later, uses a byte at 0040:0100 (= 0000:0500)
  866.     to determine whether a print screen is currently in progress.  If it
  867.     is, pressing PrintScreen again is ignored.  So to disable the screen
  868.     snapshot, all you have to do is write a 1 to that byte.  When the
  869.     user presses PrintScreen, the BIOS will think that a print screen is
  870.     already in progress and will ignore the user's keypress.  You can re-
  871.     enable PrintScreen by zeroing the same byte.
  872.  
  873.     Here's some simple code:
  874.  
  875.         void prtsc_allow(int allow) /* 0=disable, nonzero=enable */ {
  876.             unsigned char far* flag = (unsigned char far*)0x00400100UL;
  877.             *flag = (unsigned char)!allow;
  878.         }
  879.  
  880.     2) Continuous echo of screen to printer
  881.  
  882.     If ANSI.SYS is loaded, you can easily disable the continuous echo of
  883.     screen to printer (Ctrl-P or Ctrl-PrtSc).  Just redefine the keys by
  884.     "printing" strings like these to the screen (BASIC print, C
  885.     printf(), Pascal Write statements, or ECHO command in batch files),
  886.     where <27> stands for the Escape character, ASCII 27:
  887.  
  888.         <27>[0;114;"Ctrl-PrtSc disabled"p
  889.         <27>[16;"^P"p
  890.  
  891.     If you haven't installed ANSI.SYS, I can't offer an easy way to
  892.     disable the echo-screen-to-printer function.
  893.  
  894.     Actually, you might not need to disable Ctrl-P and Ctrl-PrtSc.  If
  895.     your only concern is not locking up your machine, when you see the
  896.     "Abort, Retry, Ignore, Fail" prompt just press Ctrl-P again and then
  897.     press I.  As an alternative, install one of the many print spoolers
  898.     that intercept printer-status queries and always return "Printer
  899.     ready".
  900.  
  901. Subject:  305. How can my program turn NumLock (CapsLock, ScrollLock) on
  902.                or off?
  903.  
  904.     First, if you just don't want NumLock turned on when you reboot,
  905.     check your system's setups.  (Use Ctrl-Alt-Enter any time, or press
  906.     a special key like Del at boot time, or run the setup program
  907.     supplied with your system.)  Many systems now have an option in
  908.     setup to turn NumLock off at boot time.
  909.  
  910.     You need to twiddle bit 5, 6, or 4 of location 0040:0017.  Here's
  911.     some code:  lck() turns on a lock state, and unlck() turns it off.
  912.     (The status lights on some keyboards may not reflect the change.  If
  913.     yours is one, call INT 16 AH=2, "get shift status", and that may
  914.     update them.  It will certainly do no harm.)
  915.  
  916.         #define NUM_LOCK  (1 << 5)
  917.         #define CAPS_LOCK (1 << 6)
  918.         #define SCRL_LOCK (1 << 4)
  919.         void lck(int shiftype) {
  920.             char far* kbdstatus = (char far*)0x00400017UL;
  921.             *kbdstatus |= (char)shiftype;
  922.         }
  923.         void unlck(int shiftype) {
  924.             char far* kbdstatus = (char far*)0x00400017UL;
  925.             *kbdstatus &= ~(char)shiftype;
  926.         }
  927.  
  928. Subject:  306. How can I speed up the keyboard's auto-repeat? (rev: 24
  929.                Mar 1994)
  930.  
  931.     The keyboard speed has two components: delay (before a key that you
  932.     hold down starts repeating) and typematic rate (the speed once the
  933.     key starts repeating).  Most BIOS versions since 1986 let software
  934.     change the delay and typematic rate by calling INT 16 AH=3, "set
  935.     typematic rate and delay"; see Ralf Brown's interrupt list (Q C03).
  936.     If you have DOS 4.0 or later, you can use the MODE CON command that
  937.     you'll find in your DOS manual.
  938.  
  939.     On 83-key keyboards (mostly XTs), the delay and typematic rate can't
  940.     easily be changed.  According to PC Magazine 15 Jan 1991 (x:1) page
  941.     409, to adjust the typematic rate you need "a memory-resident
  942.     program which simply '[watches]' the keyboard to see if you're
  943.     holding down a key ... and after a certain time [starts] stuffing
  944.     extra copies of the held-down key into the buffer."  No source code
  945.     is given in that issue; but the QUICKEYS utility that PC Magazine
  946.     published in 1986 does this sort of watching (not verified); source
  947.     and object code are downloadable in
  948.  
  949.         /pub/msdos/pcmag/vol5n05.zip from SimTel.
  950.  
  951. Subject:  307. What is the SysRq key for?
  952.  
  953.     There is no standard use for the key.  The BIOS keyboard routines in
  954.     INT 16 simply ignore it; therefore so do the DOS input routines in
  955.     INT 21 as well as the keyboard routines in libraries supplied with
  956.     high-level languages.
  957.  
  958.     When you press or release a key, the keyboard triggers hardware line
  959.     IRQ1, and the CPU calls INT 9.  INT 9 reads the scan code from the
  960.     keyboard and the shift states from the BIOS data area.
  961.  
  962.     What happens next depends on whether your PC's BIOS supports an
  963.     enhanced keyboard (101 or 102 keys).  If so, INT 9 calls INT 15
  964.     AH=4F to translate the scan code.  If the translated scan code is 54
  965.     hex (for the SysRq key) then INT 9 calls INT 15 AH=85 and doesn't
  966.     put the keystroke into the keyboard buffer.  The default handler of
  967.     that function does nothing and simply returns.  (If your PC has an
  968.     older BIOS that doesn't support the extended keyboards, INT 15 AH=4F
  969.     is not called.  Early ATs have 84-key keyboards, so their BIOS calls
  970.     INT 15 AH=85 but not 4F.)
  971.  
  972.     Thus your program is free to use SysRq for its own purposes, but at
  973.     the cost of some programming.  You could hook INT 9, but it's
  974.     probably easier to hook INT 15 AH=85, which is called when SysRq is
  975.     pressed or released.
  976.  
  977. Subject:  308. How can my program tell what kind of keyboard is on the
  978.                system?
  979.  
  980.     Ralf Brown's Interrupt List (Q C03) includes MEMORY.LST, a detailed
  981.     breakdown by Robin Walker of the contents of the BIOS system block
  982.     that starts at 0040:0000.  Bit 4 of byte 0040:0096 is "1=enhanced
  983.     keyboard installed".  C code to test the keyboard type:
  984.  
  985.         char far *kbd_stat_byte3 = (char far *)0x00400096UL;
  986.         if (0x10 & *kbd_stat_byte3)
  987.             /* 101- or 102-key keyboard is installed */
  988.  
  989.     PC Magazine 15 Jan 1991 (x:1) suggests on page 412 that "for some
  990.     clones [the above test] is not foolproof".  If you use this method
  991.     in your program you should provide the user some way to override
  992.     this test, or at least some way to tell your program to assume a non-
  993.     enhanced keyboard.  The article suggests a different approach to
  994.     determining the type of keyboard.
  995.  
  996. Subject:  309. How can I tell if input, output, or stderr has been
  997.                redirected? (rev: 24 Mar 1994)
  998.  
  999.     Normally, input and output are associated with the console (i.e.,
  1000.     with the keyboard and the screen, respectively).  If either is not,
  1001.     you know that it has been redirected.  Some source code to check
  1002.     this is available at the usual archive sites.
  1003.  
  1004.     If you program in Turbo Pascal, you'll want this downloadable
  1005.     collection of Turbo Pascal units:
  1006.  
  1007.         /pc/ts/tspa33*.zip at Garbo
  1008.         /pub/msdos/turbopas/tspa33*.zip at SimTel.
  1009.  
  1010.     (where the * is 70, 60, 55, 50, or 40 for Turbo Pascal 7.0, 6.0,
  1011.     5.5, 5.0, or 4.0 respectively.)  Source code is not included.  Also
  1012.     see the downloadable Frequently Asked Questions files by Timo Salmi:
  1013.  
  1014.         /pc/ts/tsfaqp18.zip at Garbo
  1015.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1016.  
  1017.     If you program in C, use isatty() if your implementation has it.
  1018.     Otherwise, /pub/msdos/sysutil/is_con10.zip is downloadable from
  1019.     SimTel; it includes source code.
  1020.  
  1021.     Good references for the principles are PC Magazine 16 Apr 1991 (x:7)
  1022.     page 374; Ray Duncan's {Advanced MS-DOS}, ISBN 1-55615-157-8, or
  1023.     Ralf Brown's interrupt list (Q C03) for INT 21 AX=4400; and Terry
  1024.     Dettman and Jim Kyle's {DOS Programmer's Reference: 2d edition},
  1025.     ISBN 0-88022-458-4, pages 602-603.
  1026.  
  1027. Subject:  310. How can I increase the size of the keyboard buffer? (new:
  1028.                20 June 1993)
  1029.  
  1030.     I tested only one of the many available device drivers that do this,
  1031.     namely BUF160, which extends the keyboard buffer to 160 characters.
  1032.     It performed flawlessly for two years with MS-DOS 5 and Windows 3.1.
  1033.     It's downloadable as
  1034.  
  1035.         /pub/msdos/keyboard/buf160_6.zip at SimTel
  1036.         /pc/keyboard/buf160_6.zip at Garbo.
  1037.  
  1038. Subject:  311. How can I stuff characters into the keyboard buffer?
  1039.                (new: 15 Aug 1993)
  1040.  
  1041.     If your computer has an enhanced keyboard (see "308. How can my
  1042.     program tell what kind of keyboard is on the system?"), put the scan
  1043.     code in CH and the ASCII character in CL, then execute INT 16 AH=5.
  1044.     The return in AL is 0 for success or 1 for buffer full.
  1045.  
  1046.  
  1047. section 4. Disks and files
  1048. ==========================
  1049.  
  1050. Subject:  401. What drive was the PC booted from?
  1051.  
  1052.     Under DOS 4.0 or later, use INT 21 AX=3305.  DL is returned with an
  1053.     integer indicating the boot drive (1=A:, etc.).
  1054.  
  1055. Subject:  402. How can I boot from drive b:? (rev: 24 Mar 1994)
  1056.  
  1057.     Downloadable shareware:
  1058.  
  1059.         /pub/msdos/diskutil/boot_b.zip from SimTel
  1060.         /pc/bootutil/boot_b.zip from Garbo.
  1061.  
  1062.     The included documentation says it works by writing a new boot
  1063.     sector on a disk in your a: drive that redirects the boot to your b:
  1064.     drive.  (A similar utility is bboot.zip in the same directory at
  1065.     Garbo only.)
  1066.  
  1067.     If that doesn't work, you can always interchange your a: and b:
  1068.     drives by switching ribbon cables and changing the setup in your
  1069.     BIOS.  From an article posted 27 Jan 1993 on another newsgroup:
  1070.  
  1071.     Take the "ribbon" connector, as you call it, and switch them.  To
  1072.     double check, start at the end of the cable that connects to the
  1073.     motherboard or floppy controller.  Follow the cable until you get to
  1074.     the first connector.  Connect this to the drive you want to be b:.
  1075.     After this, there should be a few lines on the cable that get
  1076.     flipped left to right.  (On most cables, they just cut the lines and
  1077.     physically reverse them.  It should be quite obvious from looking at
  1078.     the cable.)  Anyway, the connector after the pins get flipped right
  1079.     to left is the connector for your a: drive.
  1080.  
  1081. Subject:  403. Which real and virtual disk drives are valid? (rev: 15
  1082.                Aug 1993)
  1083.  
  1084.     Use INT 21 AH=29 (parse filename).  Point DS:SI at a null-terminated
  1085.     ASCII string that contains the drive letter and a colon, point ES:DI
  1086.     at a 37-byte dummy FCB buffer, and call INT 21 AX=2900.  On return,
  1087.     AL is FF if the drive is invalid, something else if the drive is
  1088.     valid.  RAM disks and SUBSTed drives are considered valid.
  1089.  
  1090.     You can detect whether the drive is ASSIGNed by using INT 2F
  1091.     AX=0601.  To check whether the drive is SUBSTed, use INT 21 AX=4409;
  1092.     or use INT 21 AH=52 to test for both JOIN and SUBST.  See Ralf
  1093.     Brown's interrupt list (Q C03).
  1094.  
  1095.     Unfortunately, the b: drive is considered valid even on a single-
  1096.     diskette system.  You can check that special case by interrogating
  1097.     the BIOS equipment byte at 0040:0010.  Bits 7-6 contain the one less
  1098.     than the number of diskette drives, so if those bits are zero you
  1099.     know that b: is an invalid drive even though function 29 says it's
  1100.     valid.
  1101.  
  1102.     Following is some code originally posted by Doug Dougherty to test
  1103.     valid drives (treating SUBSTed and JOINed drives as valid), with my
  1104.     fix for the b: special case, tested in Borland C++ 2.0 (in the small
  1105.     model):
  1106.  
  1107.         #include <dos.h>
  1108.         #include <stdio.h>
  1109.         void drvlist(void) {
  1110.             char *s = "A:", fcb_buff[37];
  1111.             int valid;
  1112.             for (   ;  *s<='Z';  (*s)++) {
  1113.                 _SI = (unsigned) s;
  1114.                 _DI = (unsigned) fcb_buff;
  1115.                 _ES = _DS;
  1116.                 _AX = 0x2900;
  1117.                 geninterrupt(0x21);
  1118.                 valid = _AL != 0xFF;
  1119.                 if (*s == 'B'  &&  valid) {
  1120.                     char far *equipbyte = (char far *)0x00400010UL;
  1121.                     valid = (*equipbyte & (3 << 6)) != 0;
  1122.                 }
  1123.                 printf("Drive '%s' is %sa valid drive.\n",
  1124.                         s, valid ? "" : "not ");
  1125.             }
  1126.         }
  1127.  
  1128.     I translated this to MSC 7.0 and tested it in small model:
  1129.  
  1130.         #include <dos.h>
  1131.         #include <stdio.h>
  1132.         void drvlist(void) {
  1133.             char *s = "A:", fcb_buff[37], *buff=fcb_buff;
  1134.             int valid;
  1135.             for (   ;  *s<='Z';  (*s)++) {
  1136.                 __asm mov si,s      __asm mov di,buff
  1137.                 __asm mov ax,ds     __asm mov es,ax
  1138.                 __asm mov ax,0x2900 __asm int 21h
  1139.                 __asm xor ah,ah     __asm mov valid,ax
  1140.                 valid = (valid != 0xFF);
  1141.                 if (*s == 'B'  &&  valid) {
  1142.                     char far *equipbyte = (char far *)0x00400010UL;
  1143.                     valid = (*equipbyte & (3 << 6)) != 0;
  1144.                 }
  1145.                 printf("Drive '%s' is %sa valid drive.\n",
  1146.                         s, valid ? "" : "not ");
  1147.             }
  1148.         }
  1149.  
  1150. Subject:  404. How can I make my single floppy drive both a: and b:?
  1151.  
  1152.     Under any DOS since DOS 2.0, you can put the command
  1153.  
  1154.         assign b=a
  1155.  
  1156.     into your AUTOEXEC.BAT file.  Then, when you type "dir b:" you'll no
  1157.     longer get the annoying prompt to insert diskette B (and the even
  1158.     more annoying prompt to insert A the next time you type "dir a:").
  1159.  
  1160.     You may be wondering why anybody would want to do this.  Suppose you
  1161.     use two different machines, maybe one at home and one at work.  One
  1162.     of them has only a 3.5" diskette drive; the other machine has two
  1163.     drives, and b: is the 3.5" one.  You're bound to type "dir b:" on
  1164.     the first one, and get the nuisance message
  1165.  
  1166.         Insert diskette for drive B: and press any key when ready.
  1167.  
  1168.     But if you assign drive b: to point to a:, you avoid this problem.
  1169.  
  1170.     Caution:  there are a few commands, such as DISKCOPY, that will not
  1171.     work right on ASSIGNed or SUBSTed drives.  See the DOS manual for
  1172.     the full list.  Before typing one of those commands, be sure to turn
  1173.     off the mapping by typing "assign" without arguments.
  1174.  
  1175.     The DOS 5.0 manual says that ASSIGN is obsolete, and recommends the
  1176.     equivalent form of SUBST: "subst b: a:\".  Unfortunately, if this
  1177.     command is executed when a: doesn't hold a diskette, the command
  1178.     fails.  ASSIGN doesn't have this problem, so under DOS 5.0 you
  1179.     should disregard that particular bit of advice in the manual.
  1180.  
  1181. Subject:  405. How can I disable access to a drive? (new: 15 Aug 1993)
  1182.  
  1183.     Reader Eric DeVolder writes that he has made available a program to
  1184.     do this.  I haven't tried it, but it's downloadable as
  1185.  
  1186.         /pub/msdos/diskutil/rmdriv20.zip from SimTel
  1187.         /pc/sysutil/rmdriv20.zip at Garbo.
  1188.  
  1189. Subject:  406. How can a batch file test existence of a directory? (rev:
  1190.                28 May 1994)
  1191.  
  1192.     The standard way, which in fact is documented in the DOS manual, is
  1193.  
  1194.         if exist d:\path\nul goto found
  1195.  
  1196.     Unfortunately, this is not entirely reliable.  I found it failed in
  1197.     Pathworks (a/k/a PCSA, DEC's network that connects PCs and VAXes),
  1198.     or on a MARS box that uses an OEM version of MS-DOS 5.0.  Readers
  1199.     have reported that it gave the wrong answer on Novell networks, on
  1200.     DR-DOS, and in a DOS window under OS/2.  By "failed" I mean that it
  1201.     "found" a directory that didn't exist, or failed to find one that
  1202.     did exist, or both.  (I'm told that IBM fixed the OS/2 bug in
  1203.     version 2.11 of OS/2.)
  1204.  
  1205.     There appears to be no foolproof way to use pure batch commands to
  1206.     test for existence of a directory.  The real solution is to write a
  1207.     program, which returns a value that your batch program can then test
  1208.     with an "if errorlevel".  Reader Duncan Murdoch kindly posted the
  1209.     following Turbo Pascal version:
  1210.  
  1211.         program existdir;
  1212.             { Confirms the existence of a directory given on the command
  1213.             line.  Returns errorlevel 2 on error, 1 if not found, 0 if
  1214.             found. }
  1215.  
  1216.         uses
  1217.             dos;
  1218.  
  1219.         var
  1220.             s : searchrec;
  1221.  
  1222.         begin
  1223.             if paramcount <> 1 then
  1224.             begin
  1225.                 writeln('Syntax:  EXISTDIR directory');
  1226.                 halt(2);
  1227.             end
  1228.             else
  1229.             begin
  1230.                 findfirst(paramstr(1),Directory,S);
  1231.                 while (Doserror = 0) and ((Directory and S.Attr) = 0) do
  1232.                     findnext(S);
  1233.                 if Doserror <> 0 then
  1234.                 begin
  1235.                     Writeln('Directory not found.');
  1236.                     halt(1);
  1237.                 end
  1238.                 else
  1239.                 begin
  1240.                     Writeln('Directory found.');
  1241.                     halt(0);
  1242.                 end;
  1243.             end;
  1244.         end.
  1245.  
  1246.     Timo Salmi also has a Turbo Pascal version in his Turbo Pascal FAQ,
  1247.     which is downloadable as
  1248.  
  1249.         /pc/ts/tsfaqp18.zip at Garbo
  1250.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1251.  
  1252. Subject:  407. Why won't my C program open a file with a path?
  1253.  
  1254.     You've probably got something like the following code:
  1255.  
  1256.         char *filename = "c:\foo\bar\mumble.dat";
  1257.         FILE *fptr;
  1258.         . . .
  1259.         fptr = fopen(filename, "r");
  1260.  
  1261.     The problem is that \f is a form feed, \b is a backspace, and \m is
  1262.     m.  Whenever you want a backslash in a string constant in C, you
  1263.     must use two backslashes:
  1264.  
  1265.         char *filename = "c:\\foo\\bar\\mumble.dat";
  1266.  
  1267.     This is a feature of every C compiler, because Dennis Ritchie
  1268.     designed C this way.  It's a problem only on MS-DOS systems, because
  1269.     only DOS (and Atari ST/TT running TOS) uses the backslash in
  1270.     directory paths.  But even in DOS this backslash convention applies
  1271.     _only_ to string constants in your source code.  For file and
  1272.     keyboard input at run time, \ is just a normal character, so users
  1273.     running your program would type in file specs the same way as in DOS
  1274.     commands, with single \ characters.
  1275.  
  1276.     Another possibility is to code all paths in source programs with /
  1277.     rather than \ characters:
  1278.  
  1279.         char *filename = "c:/foo/bar/mumble.dat";
  1280.  
  1281.     Ralf Brown writes, "All versions of the DOS kernel accept either
  1282.     forward or backslashes as directory separators.  I tend to use this
  1283.     form more frequently than backslashes since it is easier to type and
  1284.     read."  This applies to DOS function calls (and therefore to calls
  1285.     to the file library of every programming language), but not to DOS
  1286.     commands.
  1287.  
  1288. Subject:  408. How can I redirect printer output to a file? (rev: 16 Aug
  1289.                1993)
  1290.  
  1291.     Recommended: PRN2FILE from PC Magazine, downloadable as:
  1292.  
  1293.         /pub/msdos/printer/prn2file.zip at SimTel
  1294.         /pc/printer/prn2file.zip at Garbo.
  1295.  
  1296.     PC Magazine has given copies away as part of its utilities disks, so
  1297.     you may already have a copy.
  1298.  
  1299.     The directories mentioned above have lots of other utilities to
  1300.     redirect printer output.
  1301.  
  1302. Subject:  409. How can I redirect the output of a batch file? (rev: 24
  1303.                Mar 1994)
  1304.  
  1305.     Assuming the batch file is called batch.bat, to send its output
  1306.     (stdout) to another file, just invoke COMMAND.COM as a secondary
  1307.     command processor:
  1308.  
  1309.         command /c batch parameters_if_any >outfile
  1310.  
  1311.     Timo Salmi's notes on this and other batch tricks are downloadable:
  1312.  
  1313.         /pub/msdos/batutil/tsbat44.zip at SimTel
  1314.         /pc/ts/tsbat44.zip at Garbo.
  1315.  
  1316. Subject:  410. How can I redirect stderr? (rev: 24 Mar 1994)
  1317.  
  1318.     Use freopen(..., stderr) and then execute the desired command via
  1319.     system().  There are downloadable versions of programs to do this.
  1320.     I recommend this file, which includes TP4 source and executable:
  1321.  
  1322.         /pub/msdos/sysutil/rdstderr.zip from SimTel.
  1323.  
  1324.     A C example is downloadable as
  1325.  
  1326.         /pub/msdos/c/redirect.c from SimTel.
  1327.  
  1328.     I compiled it with MSC 7.0, and it works fine with one exception:
  1329.     Contrary to the included comments, redirected output starts writing
  1330.     at the beginning of the output file rather than appending.  That is
  1331.     easily solved by adding "fseek(stderr, 0L, SEEK_END);" after the
  1332.     freopen() call for stderr.
  1333.  
  1334. Subject:  411. How can my program open more files than DOS's limit of
  1335.                20? (rev: 12 Sep 1993)
  1336.  
  1337.     This is a summary of an article Ralf Brown posted on 8 August 1992,
  1338.     with some additions from a Microsoft tech note and information from
  1339.     Chin Huang.)
  1340.  
  1341.     DOS imposes some limits.  Once you overcome those, which is pretty
  1342.     easy, you may have to take additional measures to overcome the
  1343.     limitations built into your compiler's run-time library.
  1344.  
  1345.     1) Limitations imposed by DOS
  1346.  
  1347.     There are separate limits on files and file handles.  For example,
  1348.     DOS opens three files but five file handles:  CON (stdin, stdout,
  1349.     and stderr), AUX (stdaux), and PRN (stdprn).
  1350.  
  1351.     The limit in FILES= in CONFIG.SYS is a system-wide limit on files
  1352.     opened by all programs (including the three that DOS opens and any
  1353.     opened by TSRs); each process has a limit of 20 handles (including
  1354.     the five that DOS opens).  Example:  CONFIG.SYS has FILES=40.  Then
  1355.     program #1 will be able to open 15 file handles.  Assuming that the
  1356.     program actually does open 15 handles pointing to 15 different
  1357.     files, other programs could still open a total of 22 files (40-3-15
  1358.     = 22), though no one program could open more than 15 file handles.
  1359.  
  1360.     If you're running DOS 3.3 or later, you can increase the per-process
  1361.     limit of 20 file handles by a call to INT 21 AH=67, Set Handle
  1362.     Count.  Your program is still limited by the system-wide limit on
  1363.     open files, so you may also need to increase the FILES= value in
  1364.     your CONFIG.SYS file (and reboot).  The run-time library that you're
  1365.     using may have a fixed-size table of file handles, so you may also
  1366.     need to get source code for the module that contains the table,
  1367.     increase the table size, and recompile it.
  1368.  
  1369.     2) Limitations in Microsoft C run-time library
  1370.  
  1371.     In Microsoft C the run-time library limits you to 20 file handles.
  1372.     To change this, you must be aware of two limits:
  1373.  
  1374.     - file handles used with _open(), _read(), etc.: Edit _NFILE_ in
  1375.       CRT0DAT.ASM.
  1376.  
  1377.     - stream files used with fopen(), fread(), etc.: Edit _NFILE_ in
  1378.       _FILE.C for DOS or FILE.ASM for Windows/QuickWin.  This must not
  1379.       exceed the value of _NFILE_ in CRT0DAT.ASM.
  1380.  
  1381.     (QuickWin uses the constant _WFILE_ in CRT0DAT.ASM and WFILE.ASM for
  1382.     the maximum number of child text windows.)
  1383.  
  1384.     After changing the limits, recompile using CSTARTUP.BAT.  Microsoft
  1385.     recommends that you first read README.TXT in the same directory.
  1386.  
  1387.     3) Limitations in Borland C++ run-time library
  1388.  
  1389.     (Reader Chin Huang provided this information on 12 Sep 1993.)
  1390.  
  1391.     To increase the open file limit for a program you compile with
  1392.     Borland C++ 3.1, edit the file _NFILE.H in the include directory and
  1393.     change the _NFILE_ value.  Compile and link the modules FILES.C and
  1394.     FILES2.C from the lib directory into your program.
  1395.  
  1396. Subject:  412. How can I read, create, change, or delete the volume
  1397.                label?
  1398.  
  1399.     In DOS 5.0 (and possibly in 4.0 as well), there are actually two
  1400.     volume labels: the LABEL command reports only the first but changes
  1401.     both of them.
  1402.  
  1403.     - The traditional volume label is an entry with "volume label"
  1404.       attribute in the root directory of the disk.  The DIR, VOL, and
  1405.       LABEL commands report this volume label, and LABEL sets it.
  1406.  
  1407.     - There is a second volume label, which may be different, in the
  1408.       boot record along with the serial number. In DOS 4.0 and later,
  1409.       INT 21 AH=69 gets or sets the boot record's serial number and
  1410.       volume label together; see "413. How can I get the disk serial
  1411.       number?"  DIR and VOL ignore this volume label; the LABEL command
  1412.       doesn't report it but does set it.
  1413.  
  1414.     The rest of this answer assumes that by "volume label" you mean the
  1415.     traditional one, the one that DIR and VOL display.  Though it's a
  1416.     directory entry in the root directory, you can't change it using the
  1417.     newer DOS file-access functions (INT 21 AH=3C, 41, 43); instead, use
  1418.     the old FCB-oriented directory functions.  Specifically, you need to
  1419.     allocate a 64-byte buffer and a 41- byte extended FCB (file control
  1420.     block).  Call INT 21 AH=1A to find out whether there is a volume
  1421.     label.  If there is, AL returns 0 and you can change the label using
  1422.     DOS function 17 or delete it using DOS function 13.  If there's no
  1423.     volume label, function 1A will return FF and you can create a label
  1424.     via function 16.  Important points to notice are that ? wildcards
  1425.     are allowed but * are not; the volume label must be space filled not
  1426.     null terminated.
  1427.  
  1428.     The following MSC 7.0 code worked for me in DOS 5.0; the functions
  1429.     it uses have been around since DOS 2.0.  The function parameter is 0
  1430.     for the current disk, 1 for a:, 2 for b:, etc.  It doesn't matter
  1431.     what your current directory is; these functions always search the
  1432.     root directory for volume labels.  (I didn't try to change the
  1433.     volume label of any networked drives.)
  1434.  
  1435.         // Requires DOS.H, STDIO.H, STRING.H
  1436.         void vollabel(unsigned char drivenum) {
  1437.             static unsigned char extfcb[41], dta[64], status, *newlabel;
  1438.             int chars_got = 0;
  1439.             #define DOS(buff,func) __asm { __asm mov dx,offset buff   \
  1440.                 __asm mov ax,seg buff  __asm push ds  __asm mov ds,ax \
  1441.                 __asm mov ah,func  __asm int 21h  __asm pop ds        \
  1442.                 __asm mov status,al }
  1443.             #define getlabel(buff,prompt) newlabel = buff;  \
  1444.                 memset(newlabel,' ',11);  printf(prompt);   \
  1445.                 scanf("%11[^\n]%n", newlabel, &chars_got);  \
  1446.                 if (chars_got < 11) newlabel[chars_got] = ' ';
  1447.  
  1448.             // Set up the 64-byte transfer area used by function 1A.
  1449.             DOS(dta, 1Ah)
  1450.             // Set up an extended FCB and search for the volume label.
  1451.             memset(extfcb, 0, sizeof extfcb);
  1452.             extfcb[0] = 0xFF;           // denotes extended FCB
  1453.             extfcb[6] = 8;              // volume-label attribute bit
  1454.             extfcb[7] = drivenum;       // 1=A,2=B,...; 0=current drive
  1455.             memset(&extfcb[8], '?', 11);// wildcard *.*
  1456.             DOS(extfcb,11h)
  1457.             if (status == 0) {          // DTA has volume label's FCB
  1458.                 printf("volume label is %11.11s\n", &dta[8]);
  1459.                 getlabel(&dta[0x18],
  1460.                     "new label (\"delete\" to delete): ");
  1461.                 if (chars_got == 0)
  1462.                     printf("label not changed\n");
  1463.                 else if (strncmp(newlabel,"delete  ",11) == 0) {
  1464.                     DOS(dta,13h)
  1465.                     printf(status ? "label failed\n" :
  1466.                                     "label deleted\n");
  1467.                 }
  1468.                 else {                  // user wants to change label
  1469.                     DOS(dta,17h)
  1470.                     printf(status ? "label failed\n" :
  1471.                                     "label changed\n");
  1472.                 }
  1473.             }
  1474.             else {                      // no volume label was found
  1475.                 printf("disk has no volume label.\n");
  1476.                 getlabel(&extfcb[8], "new label (<Enter> for none): ");
  1477.                 if (chars_got > 0) {
  1478.                     DOS(extfcb,16h)
  1479.                     printf(status ? "label failed\n" :
  1480.                                     "label created\n");
  1481.                 }
  1482.             }
  1483.         }        // end function vollabel
  1484.  
  1485. Subject:  413. How can I get the disk serial number? (rev: 6 Jun 1994)
  1486.  
  1487.     If the disk was formattted by DOS 4.0 or later, use INT 21: AX=6900
  1488.     gets the serial number; AX=6901 sets it.  (The disk serial number
  1489.     doesn't exist if the disk was formatted with an earlier version of
  1490.     DOS, or with some third-party formatters.)  See Ralf Brown's
  1491.     interrupt list (Q C03), or PC Magazine July 1992 (xi:13) page 496,
  1492.     for details.
  1493.  
  1494.     INT 21 AH=69 also gets and sets the volume label in the boot record,
  1495.     which is not necessarily the same as "the" volume label displayed by
  1496.     the DIR, VOL, and LABEL commands.  For that volume label, see "412.
  1497.     How can I read, create, change, or delete the volume label?"
  1498.  
  1499. Subject:  414. What's the format of .OBJ, .EXE., .COM files?
  1500.  
  1501.     Please see "206. What's the format of an .OBJ file?"; "207. What's
  1502.     the format of an .EXE header?"; and "208. What's the difference
  1503.     between .COM and .EXE formats?"
  1504.  
  1505. Subject:  415. How can I flush the software disk cache?
  1506.  
  1507.     Please see "701. How can a program reboot my PC?"
  1508.  
  1509.  
  1510. section 5. Serial ports (COM ports)
  1511. ===================================
  1512.  
  1513. Subject:  501. How do I set my machine up to use COM3 and COM4?
  1514.  
  1515.     Unless your machine is fairly old, it's probably already set up.
  1516.     After installing the board that contains the extra COM port(s),
  1517.     check the I/O addresses in word 0040:0004 or 0040:0006.  (In DEBUG,
  1518.     type "D 40:4 L4" and remember that every word is displayed low byte
  1519.     first, so if you see "03 56" the word is 5603.)  If those addresses
  1520.     are nonzero, your PC is ready to use the ports and you don't need
  1521.     the rest of this answer.
  1522.  
  1523.     If the I/O address words in the 0040 segment are zero after you've
  1524.     installed the I/O board, you need some code to store these values
  1525.     into the BIOS data segment:
  1526.  
  1527.         0040:0004  word  I/O address of COM3
  1528.         0040:0006  word  I/O address of COM4
  1529.         0040:0011  byte (bits 3-1): number of serial ports installed
  1530.  
  1531.     The documentation with your I/O board should tell you the port
  1532.     addresses.  When you know the proper port addresses, you can add
  1533.     code to your program to store them and the number of serial ports
  1534.     into the BIOS data area before you open communications.  Or you can
  1535.     use DEBUG to create a little program to include in your AUTOEXEC.BAT
  1536.     file, using this script:
  1537.  
  1538.         n SET_ADDR.COM      <--- or a different name ending in .COM
  1539.         a 100
  1540.         mov  AX,0040
  1541.         mov  DS,AX
  1542.         mov  wo [0004],aaaa <--- replace aaaa with COM3 address or 0
  1543.         mov  wo [0006],ffff <--- replace ffff with COM4 address or 0
  1544.         and  by [0011],f1
  1545.         or   by [0011],8    <--- use number of serial ports times 2
  1546.         mov  AH,0
  1547.         int  21
  1548.                             <--- this line must be blank
  1549.         rCX
  1550.         1f
  1551.         rBX
  1552.         0
  1553.         w
  1554.         q
  1555.  
  1556. Subject:  502. How do I find the I/O address of a COM port? (rev: 24 Mar
  1557.                1994)
  1558.  
  1559.     Look in the four words beginning at 0040:0000 for COM1 through COM4.
  1560.     (The DEBUG command "D 40:0 L8" will do this.  Remember that words
  1561.     are stored and displayed low byte first, so a word value of 03F8
  1562.     will be displayed as F8 03.)  If the value is zero, that COM port is
  1563.     not installed (or you've got an old BIOS; see "501. How do I set my
  1564.     machine up to use COM3 and COM4?").  If the value is nonzero, it is
  1565.     the I/O address of the transmit/receive register for the COM port.
  1566.     Each COM port occupies eight consecutive I/O addresses (though many
  1567.     chips use only the first seven).
  1568.  
  1569.     Here's some C code to find the I/O address:
  1570.  
  1571.         unsigned ptSel(unsigned comport) {
  1572.             unsigned io_addr;
  1573.             if (comport >= 1  &&  comport <= 4) {
  1574.                 unsigned far *com_addr = (unsigned far *)0x00400000UL;
  1575.                 io_addr = com_addr[comport-1];
  1576.             }
  1577.             else
  1578.                 io_addr = 0;
  1579.             return io_addr;
  1580.         }
  1581.  
  1582.     You might also want to explore Port Finder, downloadable as
  1583.  
  1584.         /pub/msdos/io_util/pf271.zip at SimTel
  1585.         /pub/msdos/utilities/sysutl/pf271.zip at nic.funet.fi
  1586.  
  1587.     I haven't tried it myself, but a posted article reviewed it very
  1588.     favorably and said it also lets you swap ports around.
  1589.  
  1590. Subject:  503. But aren't the COM ports always at I/O addresses 3F8,
  1591.                2F8, 3E8, and 2E8?
  1592.  
  1593.     The first two are usually right (though not always); the last two
  1594.     are different on many machines.
  1595.  
  1596. Subject:  504. How do I configure a COM port and use it to transmit
  1597.                data? (rev: 17 Sep 1993)
  1598.  
  1599.     Do you want actual code, or do you want books that explain what's
  1600.     going on?
  1601.  
  1602.     1) Source code
  1603.  
  1604.     First, check your compiler's run-time library.  Many compilers offer
  1605.     functions similar to Microsoft C's _bios_serialcom() or Borland's
  1606.     bioscom(), which may meet your needs.
  1607.  
  1608.     Second, check for downloadable resources at SimTel and Garbo.  At
  1609.     SimTel, /pub/msdos/c/pcl4c34.zip (March 1993) is described as
  1610.     "Asynchronous communications library for C"; Garbo has a whole
  1611.     /pc/comm directory.  Also, an extended example is in Borland's
  1612.     TechFax TI445, downloadable as part of
  1613.  
  1614.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  1615.         /pc/turbopas/bchelp10.zip at Garbo.
  1616.  
  1617.     Though written by Borland, much of it is applicable to other forms
  1618.     of C, and it should give you ideas for other programming languages.
  1619.  
  1620.     2) Reference books
  1621.  
  1622.     Highly recommended: Joe Campbell's {C Programmer's Guide to Serial
  1623.     Communications}, ISBN 0-672-22584-0.  He gives complete details on
  1624.     how serial ports work, along with complete programs for doing polled
  1625.     or interrupt-driver I/O.  The book is quite thick, and none of it
  1626.     looks like filler.
  1627.  
  1628.     If Campbell's book is overkill for you, you'll find a good short
  1629.     description of serial I/O in {DOS 5: A Developer's Guide}, ISBN
  1630.     1-55851-177-6, by Al Williams.
  1631.  
  1632.     Finally, a reader has recommended {Serial Communications Programming
  1633.     in C/C++} by Mark Goodwin (ISBN 1558281983), with source code in the
  1634.     book and on disk.  Topics include the basics, various methods of
  1635.     serial communications on the PC (with consideration of high-speed
  1636.     modems), ANSI screen interface, file transfer protocols (Xmodem and
  1637.     Ymodem), etc.  There is code in C, and that code is extended into a
  1638.     C++ class for those who use C++.  There are also subroutines in
  1639.     Assembly.
  1640.  
  1641.     3) Downloadable information files
  1642.  
  1643.     A "Serial Port FAQ" is occasionally posted to this newsgroup, and is
  1644.     downloadable as multiple files:
  1645.  
  1646.         /pub/usenet/comp.os.msdos.programmer/T_S_P*_3 from rtfm.mit.edu
  1647.         /pub/E-Technik/afd/*Serial* from pfsparc02.phil15.uni-sb.de.
  1648.  
  1649.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  1650.     archived?"
  1651.  
  1652.     (The uni-sb.de archive administrator warns that the ftp address may
  1653.     change, sometime in the future, to etcip1.ee.uni-sb.de.)
  1654.  
  1655.  
  1656. section 6. Other hardware questions and problems
  1657. ================================================
  1658.  
  1659. Subject:  601. Which 80x86 CPU is running my program? (rev: 24 Mar 1994)
  1660.  
  1661.     According to an article posted by Michael Davidson, Intel's approved
  1662.     code for distinguishing among 8086, 80286, 80386, and 80486 and for
  1663.     detecting the presence of an 80287 or 80387 is published in Intel's
  1664.     486SX processor manual (order number 240950-001).  David
  1665.     Kirschbaum's improved version of this is downloadable as
  1666.  
  1667.         /pub/msdos/sysinfo/cpuid593.zip from SimTel
  1668.         /pc/sysinfo/cpuid593.zip from Garbo.
  1669.  
  1670.     According to an article posted by its author, WCPU knows the
  1671.     differences between DX and SX varieties of 386 and 486 chips, and
  1672.     can detect a math coprocessor and a Pentium.  It's downloadable as
  1673.  
  1674.         /pub/msdos/sysinfo/wcpu050.zip at SimTel
  1675.         /pc/sysinfo/wcpu050.zip at Garbo.
  1676.  
  1677. Subject:  602. How can a C program send control codes to my printer?
  1678.  
  1679.     If you just fprintf(stdprn, ...), C will translate some of your
  1680.     control codes.  The way around this is to reopen the printer in
  1681.     binary mode:
  1682.  
  1683.         prn = fopen("PRN", "wb");
  1684.  
  1685.     You must use a different file handle because stdprn isn't an lvalue.
  1686.     By the way, PRN or LPT1 must not be followed by a colon in DOS 5.0.
  1687.  
  1688.     There's one special case, Ctrl-Z (ASCII 26), the DOS end-of-file
  1689.     character.  If you try to send an ASCII 26 to your printer, DOS
  1690.     simply ignores it.  To get around this, you need to reset the
  1691.     printer from "cooked" to "raw" mode.  Microsoft C users must use INT
  1692.     21 AH=44, "get/set device information".  Turbo C and Borland C++
  1693.     users can use ioctl to accomplish the same thing:
  1694.  
  1695.         ioctl(fileno(prn), 1, ioctl(fileno(prn),0) & 0xFF | 0x20, 0);
  1696.  
  1697.     An alternative approach is simply to write the printer output into a
  1698.     disk file, then copy the file to the printer with the /B switch.
  1699.  
  1700.     A third approach is to bypass DOS functions entirely and use the
  1701.     BIOS printer functions at INT 17.  If you also fprintf(stdprn,...)
  1702.     in the same program, you'll need to use fflush() to synchronize
  1703.     fprintf()'s buffered output with the BIOS's unbuffered.
  1704.  
  1705.     By the way, if you've opened the printer in binary mode from a C
  1706.     program, remember that outgoing \n won't be translated to carriage
  1707.     return/line feed.  Depending on your printer, you may need to send
  1708.     explicit \n\r sequences.
  1709.  
  1710. Subject:  603. How can I redirect printer output to a file?
  1711.  
  1712.     Please see "408. How can I redirect printer output to a file?"
  1713.  
  1714. Subject:  604. Which video adapter is installed?
  1715.  
  1716.     The technique below should work if your BIOS is not too old.  It
  1717.     uses three functions from INT 10, the BIOS video interrupt.  (If
  1718.     you're using a Borland language, you may not have to do this the
  1719.     hard way.  Look for a function called DetectGraph or something
  1720.     similar.)
  1721.  
  1722.     Set AX=1200, BL=32 and call INT 10.  If AL returns 12, you have a
  1723.     VGA.  If not, set AH=12, BL=10 and call INT 10 again.  If BL returns
  1724.     0,1,2,3, you have an EGA with 64,128,192,256K memory.  If not, set
  1725.     AH=0F and call INT 10 a third time.  If AL is 7, you have an MDA
  1726.     (original monochrome adapter) or Hercules; if not, you have a CGA.
  1727.  
  1728.     This worked when tested with a VGA, but I had no other adapter types
  1729.     to test it with.
  1730.  
  1731. Subject:  605. How do I switch to 43- or 50-line mode?
  1732.  
  1733.     /pub/msdos/screen/vidmode.zip, downloadable from SimTel, contains
  1734.     .COM utilities and .ASM source code.
  1735.  
  1736. Subject:  606. How can I find the Microsoft mouse position and button
  1737.                status?
  1738.  
  1739.     Use INT 33 AH=3, described in Ralf Brown's interrupt list (Q C03).
  1740.  
  1741.     The Windows manual says that the Logitech mouse is compatible with
  1742.     the Microsoft one, so the interrupt will probably work the same.
  1743.  
  1744.     Also, many files are downloadable from
  1745.  
  1746.         /pub/msdos/mouse/*.* at SimTel.
  1747.  
  1748. Subject:  607. How can I access a specific address in the PC's memory?
  1749.                (rev: 6 Jun 1994)
  1750.  
  1751.     First check the library that came with your compiler.  Many vendors
  1752.     have some variant of peek and poke functions. For example:
  1753.  
  1754.     - In Turbo Pascal, use the pseudo-arrays Mem, MemW, and MemL.  Be
  1755.       sure you use the correct array for the size of data you want to
  1756.       access: byte, word, or double word.
  1757.  
  1758.     - In Turbo C/Borland C, and in recent versions of Microsoft C, use
  1759.       MK_FP; in older versions of Microsoft C, use FP_OFF and FP_SEG.
  1760.       (Caution:  Turbo C and Turbo C++ also have FP_OFF and FP_SEG
  1761.       macros, but they can't be used to construct a pointer.)  Be sure
  1762.       to pick the right data type: probably "unsigned char far *" if
  1763.       you're planning to access bytes and "unsigned short far *" for
  1764.       words.  (The "far" isn't needed if your memory model uses 32-bit
  1765.       data pointers, but including it does no harm.)
  1766.  
  1767.     By the way, it's not useful to talk about "portable" ways to do
  1768.     this.  Any operation that is tied to a specific memory address is
  1769.     not likely to work on another kind of machine.
  1770.  
  1771. Subject:  608. How can I read or write my PC's CMOS memory? (rev: 24 Mar
  1772.                1994)
  1773.  
  1774.     There are a great many public-domain utilities that do this.  These
  1775.     are downloadable from SimTel in directory /pub/msdos/at:
  1776.  
  1777.         cmos14.zip     5965  920817  Saves/restores CMOS to/from file
  1778.         cmoser11.zip  28323  910721  386/286 enhanced CMOS setup program
  1779.         cmosram.zip   76096  920214  Save AT/386/486 CMOS data to file
  1780.             and restore
  1781.         rom2.zip      15692  900131  Save AT and 386 CMOS data to file
  1782.             and restore
  1783.         setup21.zip   18172  880613  Setup program which modifies CMOS
  1784.             RAM
  1785.         viewcmos.zip  11068  900225  Display contents of AT CMOS RAM,
  1786.             w/C source
  1787.  
  1788.     A program to check and display CMOS memory (but not write to it) is
  1789.     downloadable as part of
  1790.  
  1791.         /pc/ts/tsutle22.zip at Garbo
  1792.         /pub/msdos/sysutil/tsutle22.zip at SimTel.
  1793.  
  1794.     Good reports of CMOS299.ZIP, available in the pc.dir directory of
  1795.     cantva.canterbury.ac.nz [132.181.30.3], have been posted.
  1796.  
  1797.     Of the above, my only experience is with CMOSRAM, which seems to
  1798.     work fine.  It contains an excellent (and witty) .DOC file that
  1799.     explains the hardware involved and gives specific recommendations
  1800.     for preventing disaster or recovering from it.  It's $5 shareware.
  1801.  
  1802.     Robert Jourdain's {Programmer's Problem Solver for the IBM PC, XT,
  1803.     and AT} has code for accessing the CMOS RAM, according to an article
  1804.     posted in this newsgroup.
  1805.  
  1806. Subject:  609. How can I access memory beyond 640K? (rev: 24 Mar 1994)
  1807.  
  1808.     PC Magazine 29 June 1993 (xii:12) pages 302-304 carry an article,
  1809.     "How DOS Programs Can Use Over 1MB of RAM".
  1810.  
  1811.  
  1812. section 7. Other software questions and problems
  1813. ================================================
  1814.  
  1815. Subject:  701. How can a program reboot my PC? (rev: 24 Mar 1994)
  1816.  
  1817.     You can generate a "cold" boot or a "warm" boot.  A cold boot is the
  1818.     same as turning the power off and on; a warm boot is the same as
  1819.     Ctrl-Alt-Del and skips the power-on self 'test.
  1820.  
  1821.     For a warm boot, store the hex value 1234 in the word at 0040:0072.
  1822.     For a cold boot, store 0 in that word.  Then, if you want to live
  1823.     dangerously, jump to address FFFF:0000.  Here's C code to do it:
  1824.  
  1825.         /* WARNING:  data loss possible */
  1826.         void bootme(int want_warm)  /* arg 0 = cold boot, 1 = warm */ {
  1827.             void (far* boot)(void) = (void (far*)(void))0xFFFF0000UL;
  1828.             unsigned far* type = (unsigned far*)0x00400072UL;
  1829.             *type = (want_warm ? 0x1234 : 0);
  1830.             (*boot)( );
  1831.         }
  1832.  
  1833.     What's wrong with that method?  It will boot right away, without
  1834.     closing files, flushing disk caches, etc.  If you boot without
  1835.     flushing a write-behind disk cache (if one is running), you could
  1836.     lose data or trash the file allocation table in your hard drive.
  1837.  
  1838.     There are two methods of signaling the cache to flush its buffers:
  1839.     (1) simulate a keyboard Ctrl-Alt-Del in the keystroke translation
  1840.     function of the BIOS (INT 15 AH=4F; but see notes below), and (2)
  1841.     issue a disk reset (DOS function 0D).  Most disk-cache programs hook
  1842.     one or both of those interrupts, so if you use both methods you'll
  1843.     probably be safe.
  1844.  
  1845.     When user code simulates a Ctrl-Alt-Del, one or more of the programs
  1846.     that have hooked INT 15 AH=4F can ask that the key be ignored by
  1847.     clearing the carry flag.  For example, HyperDisk does this when it
  1848.     has started but not finished a cache flush.  So if the carry flag
  1849.     comes back cleared, the boot code has to wait a couple of clock
  1850.     ticks and then try again.  (None of this matters on older machines
  1851.     whose BIOS can't support 101- or 102-key keyboards; see the
  1852.     discussion of INT 21 AH=4F in "307. What is the SysRq key for?")
  1853.  
  1854.     C code that tries to signal the disk cache (if any) to flush is
  1855.     given below.  Turbo Pascal code by Timo Salmi that does more or less
  1856.     the same job may be found at question 49 (as of this writing) in the
  1857.     Turbo Pascal FAQ in comp.lang.pascal, and is downloadable as file
  1858.     FAQPAS2.TXT, which is part of
  1859.  
  1860.         /pc/ts/tsfaqp18.zip at Garbo
  1861.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1862.  
  1863.     Here's C code that reboots after trying to signal the disk cache:
  1864.  
  1865.         #include <dos.h>
  1866.         void bootme(int want_warm)  /* arg 0 = cold boot, 1 = warm */ {
  1867.             union REGS reg;
  1868.             void    (far* boot)(void) = (void (far*)(void))0xFFFF0000UL;
  1869.             unsigned far* boottype    =     (unsigned far*)0x00400072UL;
  1870.             char     far* shiftstate  =         (char far*)0x00400017UL;
  1871.             unsigned      ticks;
  1872.             int           time_to_waste;
  1873.             /* Simulate reception of Ctrl-Alt-Del: */
  1874.             for (;;) {
  1875.                 *shiftstate |= 0x0C;    /* turn on Ctrl & Alt */
  1876.                 reg.h.ah = 0x4F;        /* see notes below */
  1877.                 reg.h.al = 0x53;        /* 0x53 = Del's scan code */
  1878.                 reg.x.cflag = 1;        /* sentinel for ignoring key */
  1879.                 int86(0x15, ®, ®);
  1880.                 /* If carry flag is still set, we've finished. */
  1881.                 if (reg.x.cflag)
  1882.                     break;
  1883.                 /* Else waste some time before trying again: */
  1884.                 reg.h.ah = 0;
  1885.                 int86(0x1A, ®, ®);/* system time into CX:DX */
  1886.                 ticks = reg.x.dx;
  1887.                 for (time_to_waste = 3;  time_to_waste > 0;  ) {
  1888.                     reg.h.ah = 0;
  1889.                     int86(0x1A, ®, ®);
  1890.                     if (ticks != reg.x.dx)
  1891.                         ticks = reg.x.dx , --time_to_waste;
  1892.                 }
  1893.             }
  1894.             /* Issue a DOS disk reset request: */
  1895.             reg.h.ah = 0x0D;
  1896.             int86(0x21, ®, ®);
  1897.             /* Set boot type and boot: */
  1898.             *boottype = (want_warm ? 0x1234 : 0);
  1899.             (*boot)( );
  1900.         }
  1901.  
  1902.     Reader Timo Salmi reported (26 July 1993) that the INT 15 AH=4F call
  1903.     may not work on older PCs (below AT, XT2, XT286), according to Ralf
  1904.     Brown's interrupt list (Q C03).
  1905.  
  1906.     Reader Roger Fulton reported (1 July 1993) that INT 15 AH=4F hangs
  1907.     even a modern PC "ONLY when ANSI.SYS [is] loaded high using
  1908.     EMM386.EXE.  (Other things loaded high with EMM386.EXE were OK;
  1909.     ANSI.SYS loaded high with QEMM386.SYS was OK; ANSI.SYS loaded low
  1910.     with EMM386.EXE installed was OK.)"  His solution was to use only
  1911.     the disk reset, INT 21 AH=0D, which does flush SMARTDRV, then wait
  1912.     five seconds in hopes that any other disk-caching software would
  1913.     have time to flush its queue.
  1914.  
  1915.     Reader Per Bergland reported (10 Sep 1993) that the jump to
  1916.     FFFF:0000 will not work in Windows or other protected-mode programs.
  1917.     (For example, when the above reboot code ran in a DOS session under
  1918.     Windows, a box with "waiting for system shutdown" appeared.  The PC
  1919.     hung and had to be reset by cycling power.)  His solution, which
  1920.     does a cold boot not a warm boot, is to pulse pin 0 of the 8042
  1921.     keyboard controller, which is connected to the CPU's "reset" line.
  1922.     He has tested the following code on various Compaqs, and expects it
  1923.     will work for any AT-class machine; he cautions that you must first
  1924.     flush the disk cache as indicated above.
  1925.  
  1926.             cli
  1927.         @@WaitOutReady:   ; Busy-wait until 8042 ready for new command
  1928.             in al,64h         ; read 8042 status byte
  1929.             test al,00000010b ; this bit indicates input buffer full
  1930.             jnz @@WaitOutReady
  1931.             mov al,0FEh       ; Pulse "reset" = 8042 pin 0
  1932.             out 64h,al
  1933.             ; The PC will reboot now
  1934.  
  1935. Subject:  702. How can I time events with finer resolution than the
  1936.                system clock's 55 ms (about 18 ticks a second)? (rev: 24
  1937.                Mar 1994)
  1938.  
  1939.         The following files, among others, are downloadable from SimTel:
  1940.  
  1941.         /pub/msdos/at :
  1942.         atim.zip       4783  881126  Precision program timing for AT
  1943.  
  1944.         /pub/msdos/c :
  1945.         millisec.zip  37734  911205  MSC/asm src for millisecond timing
  1946.         mschrt3.zip   53708  910605  High-res timer toolbox for MSC 5.1
  1947.         msec_12.zip    8484  920320  High-def timer v1.2 (C,ASM)
  1948.         ztimer11.zip  77625  920428  Microsecond timer for C, C++, ASM
  1949.             (also at Garbo as /pc/c/ztimer11.zip)
  1950.  
  1951.         /pub/msdos/turbo_c :
  1952.         tchrt3.zip    53436  910606  High-res timer for Turbo C 2.0
  1953.         tctimer.zip   15609  891030  High-res timing for Turbo C
  1954.             (same as /pc/c/tctimer.zoo at Garbo; both are version 1.0)
  1955.  
  1956.     For Turbo Pascal users, source and object code are downloadable in
  1957.  
  1958.         /pub/msdos/turbopas/bonus507.zip at SimTel
  1959.         /pc/turbopas/bonus507.zip at Garbo.
  1960.  
  1961.     Also see "Q: How is millisecond timing done?" in FAQPAS.TXT,
  1962.     downloadable as part of
  1963.  
  1964.         /pc/ts/tsfaqp18.zip at Garbo
  1965.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1966.  
  1967. Subject:  703. How can I find the error level of the previous program?
  1968.                (rev: 24 Mar 1994)
  1969.  
  1970.     First, which previous program are you talking about?  If your
  1971.     current program ran another one, when the child program ends its
  1972.     error level is available to the program that spawned it.  Most high-
  1973.     level languages provide a way to do this; for instance, in Turbo
  1974.     Pascal it's Lo(DosExitCode) and the high byte gives the way in which
  1975.     the child terminated.  In Microsoft C, the exit code of a
  1976.     synchronous child process is the return value of the spawn-type
  1977.     function that creates the process.
  1978.  
  1979.     If your language doesn't have a function to return the error code of
  1980.     a child process, you can use INT 21 AH=4D (get return code).  By the
  1981.     way, this will tell you the child's exit code and the manner of its
  1982.     ending (normal, Ctrl-C, critical error, or TSR).
  1983.  
  1984.     It's much trickier if the current program wants to get the error
  1985.     level of the program that ran and finished before this one started.
  1986.     G.A.Theall has published source and compiled code to do this; the
  1987.     code is downloadable as
  1988.  
  1989.         /pub/msdos/batutil/errlvl13.zip at SimTel
  1990.         /pc/batchutil/errlvl12.zip (an older version) at Garbo.
  1991.  
  1992.     (The code uses undocumented features in DOS 3.3 through 5.0.  Theall
  1993.     says in the .DOC file that the values returned under 4DOS or other
  1994.     replacements won't be right.)
  1995.  
  1996. Subject:  704. How can a program set DOS environment variables? (rev: 24
  1997.                Mar 1994)
  1998.  
  1999.     Program functions that read or write "the environment" typically
  2000.     access only the program's copy of it.  What this Q really wants to
  2001.     do is to modify the active environment, the one that is affected by
  2002.     SET commands in batch files or at the DOS prompt.  You need to do
  2003.     some programming to find the active environment, and that depends on
  2004.     the version of DOS.
  2005.  
  2006.     A fairly well-written article in PC Magazine 28 Nov 1989 (viii:20),
  2007.     pages 309-314, explains how to find the active environment, and
  2008.     includes Pascal source code.  The article hints at how to change the
  2009.     environment, and suggests creating paths longer than 128 characters
  2010.     as one application.
  2011.  
  2012.     Now as for downloadable source code, there are many possibilities.
  2013.     I looked at some of these, and liked
  2014.  
  2015.         /pub/msdos/envutil/rbsetnv1.zip at SimTel
  2016.         /pc/envutil/rbsetnv1.zip at Garbo
  2017.  
  2018.     the best.  It includes some utilities to manipulate the environment,
  2019.     with source code in C.  A newer program is
  2020.  
  2021.         /pub/msdos/batutil/strings2.zip at SimTel
  2022.         part of /pc/pcmag/vol11n22.zip at Garbo,
  2023.  
  2024.     which is the code from PC Magazine 22 Dec 1992 (xi:22).
  2025.  
  2026.     You can also use a call to INT 2E, Pass Command to Interpreter for
  2027.     Execution; see Ralf Brown's interrupt list (Q C03) for details and
  2028.     cautions.
  2029.  
  2030. Subject:  705. How can I change the switch character to - from /? (rev:
  2031.                20 Mar 1994)
  2032.  
  2033.     Under DOS 5.0 and above, you can't--not completely, anyway.  INT 21
  2034.     AX=3700, get switch character, always returns a '/' (hex 2F).  But
  2035.     the DOS commands don't even call that function: they simply hard
  2036.     code '/' as the switch character.
  2037.  
  2038.     Some history:  DOS used to let you change the switch character by
  2039.     using SWITCHAR= in CONFIG.SYS or by calling DOS function 3701.  DOS
  2040.     commands and other programs called DOS function 3700 to find out the
  2041.     switch character.  If you changed the switch character to '-' (the
  2042.     usual choice), you could then type "dir c:/c700 -p" rather than "dir
  2043.     c:\c700 /p".  Under DOS 4.0, the DOS commands ignored the switch
  2044.     character but functions 3700 and 3701 still worked and could be used
  2045.     by other programs.  Under DOS 5.0, even those functions no longer
  2046.     work, though all DOS functions still accept '/' or '\' in file
  2047.     specs.
  2048.  
  2049.     You can reactivate the functions to get and set switchar by using
  2050.     programs like SLASH.ZIP or the sample TSR called SWITCHAR in
  2051.     amisl091.zip (see "706. How can I write a TSR (terminate-stay-
  2052.     resident utility)?").  DOS commands will still use the slash, but
  2053.     non-DOS programs that call DOS function 3700 will use your desired
  2054.     switch character.  (DOS replacements like 4DOS may honor the switch
  2055.     character for internal commands.)
  2056.  
  2057.     Some readers may wonder why this is even an issue.  Making '-' the
  2058.     switch character frees up the front slash to separate names in the
  2059.     path part of a file spec.  This is easier for the ten-fingered to
  2060.     type, and it's one less difference to remember for commuters between
  2061.     DOS and Unix.  The switch character is the only issue, since all the
  2062.     INT 21 functions accept '/' or '\' to separate directory names.
  2063.  
  2064. Subject:  706. How can I write a TSR (terminate-stay-resident utility)?
  2065.                (rev: 24 Mar 1994)
  2066.  
  2067.     There are books, and there's code to download.
  2068.  
  2069.     First, the books:
  2070.  
  2071.     - Ray Duncan's {Advanced MS-DOS}, ISBN 1-55615-157-8, gives a brief
  2072.       checklist intended for experienced programmers.  The ISBN is for
  2073.       the second edition, through DOS 4; but check to see whether the
  2074.       DOS 6 version is available yet.
  2075.  
  2076.     - {DOS 5:  A Developer's Guide} by Al Williams, ISBN 1-55851-177-6,
  2077.       goes into a little more detail, 90 pages worth!
  2078.  
  2079.     - Pascal programmers might look at {The Ultimate DOS Programmer's
  2080.       Manual} by John Mueller and Wallace Wang, ISBN 0-8306-3534-3, for
  2081.       an extended example in mixed Pascal and assembler.
  2082.  
  2083.     - For a pure assembler treatment, check Steven Holzner's {Advanced
  2084.       Assembly Language}, ISBN 0-13-663014-6.  He has a book with the
  2085.       same title out from Brady Press, but it's about half as long as
  2086.       this one.
  2087.  
  2088.     Next, the code.  Some of it is companion code to published articles,
  2089.     which are also listed below:
  2090.  
  2091.     - The Alternate Multiplex Interrupt Specification, downloadable as
  2092.  
  2093.         /pub/msdos/info/altmpx35.zip at SimTel
  2094.         /pc/programming/altmpx35.zip at Garbo
  2095.         /afs/cs/user/ralf/pub/altmpx35.zip at cs.cmu.edu
  2096.  
  2097.     - Ralf Brown's assembly-language implementation of the spec, with
  2098.       utilities in C, is downloadable as
  2099.  
  2100.         /pub/msdos/asmutil/amisl091.zip at SimTel
  2101.         /pc/c/amisl091.zip at Garbo
  2102.         /afs/cs/user/ralf/pub/amisl091.zip at cs.cmu.edu
  2103.  
  2104.     - Douglas Boling's MASM template for a TSR is downloadable as
  2105.  
  2106.         /pub/msdos/asmutl/template.zip at SimTel.
  2107.  
  2108.     - A posted article mentions Boling's "Strategies and Techniques for
  2109.       Writing State-of-the-Art TSRs that Exploit MS-DOS 5", Microsoft
  2110.       Systems Journal, Jan-Feb 1992, Volume 7, Number 1, pages 41-59,
  2111.       with examples downloadable in
  2112.  
  2113.         /pub/msdos/msjournal/msjv7-1.zip at SimTel
  2114.  
  2115.     - code for Al Stevens's "Writing Terminate-and-Stay-Resident
  2116.       Programs", Computer Language, February 1988, pages 37-48 and March
  2117.       1988, pages 67-76 is downloadable as
  2118.  
  2119.         /pub/msdos/c/tsrc.zip at SimTel
  2120.  
  2121.     - software examples to accompany Kaare Christian's "Using Microsoft
  2122.       C Version 5.1 to Write Terminate-and-Stay-Resident Programs",
  2123.       Microsoft Systems Journal, September 1988, Volume 3, Number 5,
  2124.       pages 47-57 are downloadable as
  2125.  
  2126.         /pub/msdos/msjournal/msjv3-5.arc at SimTel
  2127.  
  2128.     Finally, there are commercial products, of which TesSeRact (for C-
  2129.     language TSRs) is one of the best known.
  2130.  
  2131. Subject:  707. Why does my interrupt function behave strangely? (rev: 24
  2132.                Sep 1993)
  2133.  
  2134.     Interrupt service routines can be tricky, because you have to do
  2135.     some things differently from "normal" programs.  If you make a
  2136.     mistake, debugging is a pain because the symptoms may not point at
  2137.     what's wrong.  Your machine may lock up or behave erratically, or
  2138.     just about anything else can happen.  Here are some things to look
  2139.     for.  (See "706. How can I write a TSR (terminate-stay-resident
  2140.     utility)?" for general techniques that may prevent a problem.)
  2141.  
  2142.     First, did you fail to set up the registers at the start of your
  2143.     routine?  When your routine begins executing, you can count on
  2144.     having CS point to your code segment and SS:SP point to some valid
  2145.     stack (of unknown length), and that's it.  In particular, an
  2146.     interrupt service routine must set DS to DGROUP before accessing any
  2147.     data in its data segments.  (If you're writing in a high-level
  2148.     language, the compiler may generate this code for you automatically;
  2149.     check your compiler manual.  For instance, in Borland and Microsoft
  2150.     C, give your function the "interrupt" attribute.)
  2151.  
  2152.     Did you remember to turn off stack checking when compiling your
  2153.     interrupt server and any functions it calls?  The stack during the
  2154.     interrupt is not where the stack-checking code expects it to be.
  2155.     (Caution:  Some third-party libraries have stack checking compiled
  2156.     in, so you can't call them from your interrupt service routine.)
  2157.  
  2158.     Next, are you calling any DOS functions (INT 21, 25, or 26) in your
  2159.     routine?  DOS is not re-entrant.  This means that if your interrupt
  2160.     happens to be triggered while the CPU is executing a DOS function,
  2161.     calling another DOS function will wreak havoc.  (Some DOS functions
  2162.     are fully re-entrant, as noted in Ralf Brown's interrupt list (Q
  2163.     C03).  Also, your program can test, in a way too complicated to
  2164.     present here, when it's safe to call non-re-entrant DOS functions.
  2165.     See INT 28, INT 21 AH=34, and INT 21 AX=5D06 or 5D0B; and consult
  2166.     {Undocumented DOS} by Andrew Schulman.  Your program must read both
  2167.     the "InDOS flag" and the "critical error flag".)
  2168.  
  2169.     Is a function in your language library causing trouble?  Does it
  2170.     depend on some initializations done at program startup that is no
  2171.     longer available when the interrupt executes?  Does it call DOS (see
  2172.     preceding paragraph)?  For example, in both Borland and Microsoft C
  2173.     the memory-allocation functions (malloc(), etc..) call DOS functions
  2174.     and also depend on setups that they can't get at from inside an
  2175.     interrupt; so do the standard I/O functions like scanf() and
  2176.     printf().  Many other library functions have the same problem, so
  2177.     you can't use them inside an interrupt function without special
  2178.     precautions.
  2179.  
  2180.     Is your routine simply taking too long?  This can be a problem if
  2181.     you're hooking on to the timer interrupt, INT 1C or INT 8.  That
  2182.     interrupt expects to be called about every 55 ms, which is 18.2
  2183.     times a second.  Therefore your routine, plus any others hooked to
  2184.     the same interrupts, must execute in less than 55 ms.  If they use
  2185.     even a substantial fraction of that time, you'll see significant
  2186.     slowdowns of your foreground program.  A good discussion is
  2187.     downloadable as
  2188.  
  2189.         pub/msdos/SIMTEL20-mirror/info/intshare.zip at ni.funet.fi
  2190.         /pub/msdos/info/intshare.zip at SimTel.
  2191.  
  2192.     Did you forget to restore all registers at the end of your routine?
  2193.  
  2194.     Did you chain improperly to the original interrupt?  You need to
  2195.     restore the stack to the way it was upon entry to your routine, then
  2196.     do a far jump (not call) to the original interrupt service routine.
  2197.     (The process is a little different in high-level languages.)
  2198.  
  2199. Subject:  708. How can I write a device driver?
  2200.  
  2201.     Many books answer this in detail.  Among them are {Advanced MS-DOS}
  2202.     and {DOS 5: A Developer's Guide}, cited in the preceding Q.  Michael
  2203.     Tischer's {PC System Programming}, ISBN 1-55755-036-0, has an
  2204.     extensive treatment, as does Dettman and Kyle's {DOS Programmer's
  2205.     Reference: 2d Edition}, ISBN 0-88022-458-4.  For a really in-depth
  2206.     treatment, look for a specialized book like Robert Lai's {Writing MS-
  2207.     DOS Device Drivers}, ISBN 0-201-13185-4.
  2208.  
  2209. Subject:  709. What can I use to manage versions of software? (rev: 21
  2210.                Aug 1993)
  2211.  
  2212.     A port of the Unix RCS utility is downloadable as
  2213.  
  2214.         /pub/msdos/gnuish/rcs55ax.zip (EXE and docs) from SimTel
  2215.         /pub/msdos/gnuish/rcs55as.zip (source) from SimTel
  2216.         /pc/unix/alrcs5ex.zip (EXE and docs ?) from Garbo.
  2217.  
  2218.     This version of RCS is no longer limited to one-character extensions
  2219.     on filenames (for example, .CPP and .BAS are now OK).
  2220.  
  2221.     An RCS56 is available at a number of archive sites, but it appears
  2222.     to be unauthorized.  In response to a query, Keith Petersen, SimTel
  2223.     administrator, said that RCS56 was removed from SimTel at the
  2224.     author's request because it did not contain source code and thus was
  2225.     in violation of the GNU copyleft.
  2226.  
  2227.     As for commercial software, I posted a question asking for readers'
  2228.     experiences in July 1993 and seven readers responded.  PVCS from
  2229.     Intersolv (formerly Polymake) got five positive reviews, though
  2230.     several readers commented that it's expensive; RCS from MKS got one
  2231.     positive and one negative review; Burton TLIB got one negative
  2232.     review; DRTS from ILSI got one positive review.
  2233.  
  2234. Subject:  710. What's this "null pointer assignment" after my C program
  2235.                executes? (rev: 20 Mar 1994)
  2236.  
  2237.     Somewhere in your program, you assigned a value _through_ a pointer
  2238.     without first assigning a value _to_ the pointer.  (This might have
  2239.     been something like a strcpy() or memcpy() with a pointer as its
  2240.     first argument, not necessarily an actual assignment statement.)
  2241.     Your program may look like it ran correctly, but if you get this
  2242.     message you can be certain that there's a bug somewhere.
  2243.  
  2244.     Microsoft and Borland C, as part of their exit code (after a call to
  2245.     exit() or a return from your main function), check whether the
  2246.     location 0000 in your data segment contains a different value from
  2247.     what you started with.  If so, they infer that you must have used an
  2248.     uninitialized pointer.  This implies that the message will appear at
  2249.     the end of execution of your program regardless of where the error
  2250.     actually occurred.
  2251.  
  2252.     To track down the problem, you can put exit() calls at various spots
  2253.     in the program and narrow down where the uninitialized pointer is
  2254.     being used by seeing which added exit() makes the null-pointer
  2255.     message disappear.  Or, if your program was compiled with small or
  2256.     medium models, which use 16-bit data pointers, tell the debugger to
  2257.     set a watch at location 0000 in your data segment.  (If data
  2258.     pointers are 32 bits, as in the compact and large models, a null
  2259.     pointer will overwrite the interrupt vectors at 0000:0000 and
  2260.     probably lock up your machine.)
  2261.  
  2262.     Under MSC/C++ 7.0, you can declare the undocumented library function
  2263.  
  2264.         extern _cdecl _nullcheck(void);
  2265.  
  2266.     and then sprinkle calls to _nullcheck() through your program at
  2267.     regular intervals.
  2268.  
  2269.     Borland's TechFax document TI726 discusses the null pointer
  2270.     assignment from a Borland point of view.  It's one of many documents
  2271.     downloadable as part of
  2272.  
  2273.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  2274.         /pc/turbopas/bchelp10.zip at Garbo.
  2275.  
  2276. Subject:  711. How can a batch file tell whether it's being run in a DOS
  2277.                box under Windows? (new: 20 Mar 1994)
  2278.  
  2279.     When Windows 3.0 or 3.1 is running, the DOS environment will contain
  2280.     a definition of the string windir, in lower case.  That's not really
  2281.     useful, however, because the batch statement
  2282.  
  2283.         if "%windir%" == "" ...
  2284.  
  2285.     will test for an environment variable WINDIR in upper case.
  2286.  
  2287.     Your only real option is to write a program as suggested by the
  2288.     following Q, and have it return a value which your batch file can
  2289.     test via "if errorlevel".
  2290.  
  2291. Subject:  712. How can my program tell if it's running under Windows?
  2292.                (rev: 20 Mar 1994)
  2293.  
  2294.     Execute INT 2F AX=4680.  If AX returns 0, you're in Windows real
  2295.     mode or standard mode (or under the DOS shell).  Otherwise, call INT
  2296.     2F AX=1600.  If AL returns something other than 0 or 80, you're in
  2297.     Windows 386 enhanced mode.  See PC Magazine 24 Nov 1992 (xi:20)
  2298.     pages 492-493.
  2299.  
  2300.     For more information, see PC Magazine 26 May 1992 (xi:10) pages 345-
  2301.     346.  A program, WINMODE, is available as part of
  2302.  
  2303.         /pub/msdos/pcmag/vol11n10.zip at SimTel
  2304.         /pc/pcmag/vol11n10.zip at Garbo.
  2305.  
  2306.     PC Magazine 29 March 1994 (xiii:6) pages 312 and 320 published a new
  2307.     program, WINVER.  This would be in
  2308.  
  2309.         /pub/msdos/pcmag/vol13n06.zip at SimTel
  2310.         /pc/pcmag/vol13n06.zip at Garbo.
  2311.  
  2312. Subject:  713. How can a program tell whether ANSI.SYS is installed?
  2313.                (new: 20 Apr 1994)
  2314.  
  2315.     In DOS 4.0 and above, call INT 2F AX=1A00.  If the value FF is
  2316.     returned in AL, ANSI.SYS is installed.  For more information, see
  2317.     Ralf Brown's interrupt list (question C03).
  2318.  
  2319. Subject:  799. How do I copyright software that I write? (rev: 9 Sep
  2320.                1993)
  2321.  
  2322.     You can download a very comprehensive answer from the Internet.
  2323.     Terry Carroll posts a six-part Copyright FAQ to misc.legal,
  2324.     news.answers and other groups.  A short answer follows, not based on
  2325.     that article.
  2326.  
  2327.     Disclaimer: I am not a lawyer, and this is not legal advice.  Also,
  2328.     there are very likely to be differences in copyright law among
  2329.     nations.  No matter where you live, if significant money may be
  2330.     involved, get legal advice.  The following is adapted (and greatly
  2331.     condensed) from chapter 4 of the Chicago Manual of Style (13th
  2332.     edition, ISBN 0-226-10390-0).
  2333.  
  2334.     In the U.S. (at least), when you write something, you own the
  2335.     copyright.  (The exception that matters most to programmers is
  2336.     "works made for hire", i.e., code you write because your employer or
  2337.     client pays you to.  A contract, agreed in advance, can vest the
  2338.     copyright in the programmer even if an employee; otherwise the
  2339.     employer owns the copyright.)  You don't have to register the work
  2340.     with the Copyright Office unless (until) the copyright is infringed
  2341.     and you intend to bring suit; however, it is easier to recover
  2342.     damages in court if you did register the work within three months of
  2343.     publication.
  2344.  
  2345.     From paragraph 4.16 of the Chicago Manual:  "... the [copyright]
  2346.     notice consists of three parts: (1) the symbol [C-in-a-circle]
  2347.     (preferred because it also suits the requirements of the Universal
  2348.     Copyright Convention), the word 'Copyright', or the abbreviation
  2349.     'Copr.', (2) the year of first publication, and (3) the name of the
  2350.     copyright owner.  Most publishers also add the phrase 'All rights
  2351.     reserved' because it affords some protection in Central and South
  2352.     American countries ...."  Surprise: "(C)" is legally not the same as
  2353.     the C-in-a-circle, so those of us who are ASCII-bound must use the
  2354.     word or the abbreviation.
  2355.  
  2356.  
  2357. section A. Downloading
  2358. ======================
  2359.  
  2360. Subject:  A01. What are SimTel, Garbo, and wustl? (rev: 6 Apr 1994)
  2361.  
  2362.     These are three of the most popular archive sites, with a few
  2363.     bazillion files available for free downloading by ftp.  (For email
  2364.     access, see "A02. I have no ftp access.  How can I get files from
  2365.     the archives?".)  Many of the files are shareware and you're
  2366.     expected to send a payment directly to the authors if you use them
  2367.     regularly.
  2368.  
  2369.     In comp.archives.msdos.d, Samuel Ko posts a two-part "Useful MS-DOS
  2370.     Programs at SIMTEL20 and Garbo"; it's downloadable as
  2371.  
  2372.         /pub/msdos/info/useful34.zip at SimTel
  2373.         /pc/filelist/useful34.zip at Garbo
  2374.         /pub/usenet/news.answers/msdos-archives/part* at rtfm.mit.edu.
  2375.  
  2376.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  2377.     archived?"
  2378.  
  2379.     A few words about file names and versions:  Many files at the
  2380.     archive sites are updated from time to time.  I verified every
  2381.     filename in this FAQ as of 24 Mar 1994 by ftp to the named sites, or
  2382.     by consulting their index files.  If you can't find a file given in
  2383.     these articles as mumble12.zip, perhaps there's a newer version; try
  2384.     mumble13.zip or mumble14.zip, or mumble*.zip if your ftp program
  2385.     supports wildcards (most do so).  Please let me know of any out-of-
  2386.     date file names.
  2387.  
  2388.     This FAQ should show both Garbo and SimTel directory and file names,
  2389.     if available, for every file mentioned for downloading.  If you see
  2390.     a listing for only one of them, it means that the file was not found
  2391.     at the other site, or that the other site's catalog shows an old
  2392.     version.
  2393.  
  2394.     Also remember that caps and lower case filenames are not
  2395.     interchangeable at most archive sites.
  2396.  
  2397.     1) SimTel = oak.oakland.edu is located at the University of
  2398.     Rochester in the USA, and there are also many mirror sites including
  2399.     wuarchive.wustl.edu, archive.orts.edu, ftp.uu.net, nic.funet.fi,
  2400.     archie.au, and nctucca.edu.tw.  For instructions, see these monthly
  2401.     articles in comp.archives.msdos.announce:
  2402.  
  2403.         How to find files in the SIMTEL20 msdos collection
  2404.         How to order SIMTEL20 files via e-mail
  2405.         How to upload files to SIMTEL20
  2406.  
  2407.     These are downloadable from SimTel as
  2408.  
  2409.         /pub/msdos/filedocs/aaaread.me
  2410.         /pub/msdos/filedocs/mailserv.inf
  2411.         /pub/msdos/filedocs/upload.inf.
  2412.  
  2413.     2) Garbo = garbo.uwasa.fi [128.214.87.1] is located at the
  2414.     University of Vaasa in Finland and maintained by Timo Salmi
  2415.     (ts@uwasa.fi) and others.  Garbo and SimTel contain many of the same
  2416.     files, but there are many differences too.  Among them: the
  2417.     directory structures differ greatly, and case is significant in
  2418.     directory and file names at Garbo.
  2419.  
  2420.     3) wustl = wuarchive.wustl.edu [128.252.135.4] mirrors, among
  2421.     others, Garbo (in /systems/ibmpc/garbo) and SimTel (in
  2422.     /systems/ibmpc/msdos).  As with any mirror site, it may lag by a day
  2423.     or two, so you may not want to try it on the same day you see an
  2424.     upload notice posted.
  2425.  
  2426.     4) others:
  2427.  
  2428.     A comprehensive list of MS-DOS archive sites is downloadable as
  2429.  
  2430.         /pc/pd2/moder35.zip at Garbo
  2431.         /pub/msdos/info/moder35.zip at SimTel.
  2432.  
  2433.     For archie.au via Telnet (different from the Archie file-finding
  2434.     mail servers):  Oceanian users should try archie.au first.  Paul
  2435.     Brooks has written to say that it "mirrors Garbo and SimTel-20 (in
  2436.     /micros/pc/simtel-20, /micros/pc/garbo) as well as many other
  2437.     archives.  Telnetting to 'archie.au' and logging on as 'archie' (no
  2438.     password) will access the Oceanic ARCHIE server." Email Craig Warren
  2439.     (ccw@archie.au) for instructions if needed.
  2440.  
  2441. Subject:  A02. I have no ftp access.  How can I get files from the
  2442.                archives? (rev: 14 June 1993)
  2443.  
  2444.     First, be sure that you have no ftp access before trying email
  2445.     methods.  (Ask your sysadmin, or a knowledgeable user at your site.)
  2446.     ftp is better for you because it's faster, and it uses less net
  2447.     resources too.
  2448.  
  2449.     When using an email server, make sure the Reply-to path in your
  2450.     message is valid.  If it's not, you'll get no reply from the server.
  2451.     Do wait a few days before assuming you're not going to get a
  2452.     response; some servers have long pending queues.  After a suitable
  2453.     wait, get your sysadmin's help to correct your reply-to, and send
  2454.     your message again.
  2455.  
  2456.     Occasionally a machine goes down for an extended period, which may
  2457.     prevent a timely reply to your message.  If you're sure your message
  2458.     bears a good reply path and you haven't got a reply in a week or so,
  2459.     you might send your message again, once.  Don't post it as an
  2460.     article in a newsgroup.
  2461.  
  2462.     For files from SimTel, see "How to order SIMTEL20 files via e-mail",
  2463.     posted monthly in comp.archives.msdos.announce; or send email
  2464.     containing only the word "help" to listserv@vm1.nodak.edu.  For
  2465.     instructions on using Garbo's email server, send a request to Timo
  2466.     Salmi at ts@uwasa.fi.
  2467.  
  2468.     The DEC Western Research Labs server will get files from any ftp
  2469.     site by ftp and then email them to you.  Send email containing
  2470.     "help" to ftpmail@decwrl.dec.com.
  2471.  
  2472. Subject:  A03. Can I get archives on CD-ROM? (rev: 24 May 1993)
  2473.  
  2474.     Copies of the SimTel MS-DOS, Macintosh and Unix-C collections (also
  2475.     of wuarchive, cica, and others) are available from Walnut Creek
  2476.     CDROM, 1547 Palos Verdes, Suite 260, Walnut Creek, CA 94596-2228,
  2477.     telephone (800) 786-9907 or +1 510 674-0783, or FAX +1 510 674-0821,
  2478.     or email rab@cdrom.com.
  2479.  
  2480.     For a catalog of disks available, send email to info@cdrom.com, or
  2481.     ftp the catalog as /cdrom/catalog from cdrom.com.
  2482.  
  2483. Subject:  A04. Where do I find program <mumble>? (rev: 7 Aug 1993)
  2484.  
  2485.     You _are_ asking about shareware, freeware, or public-domain
  2486.     programs, right?  Commercial software is not legally distributed
  2487.     through the net, in general.  (Occasionally vendors will make
  2488.     patches available, but these are useful only to upgrade software you
  2489.     already own.)
  2490.  
  2491.     That said, there are several newsgroups to help you find a program.
  2492.     comp.binaries.ibm.pc.wanted is generally the best place to ask your
  2493.     question.  Please review the guidelines in "108. What other
  2494.     technical newsgroups should I know about?"
  2495.  
  2496.     Download and check the indexes from SimTel and Garbo (see "A05. How
  2497.     can I check SimTel or Garbo before I post a request for a
  2498.     program?").  Unless what you're looking for is commercial software,
  2499.     there's a good chance it will be at one or both of those sites.  The
  2500.     Archie servers maintain directories of many (not all) ftp sites
  2501.     worldwide.  You can Telnet to a server or client to search for
  2502.     files, or perform a search by email.
  2503.  
  2504. Subject:  A05. How can I check SimTel or Garbo before I post a request
  2505.                for a program? (rev: 24 Mar 1994)
  2506.  
  2507.     SimTel and Garbo have indexes of their contents, which you can
  2508.     download and then search off line.
  2509.  
  2510.     Garbo's index file, /pc/INDEX.ZIP, contains an annotated list, often
  2511.     updated, of the MS-DOS files there.  The news file /pc/pd2/news-pd2
  2512.     contains selected news on all MS-DOS directories at Garbo.
  2513.  
  2514.     SimTel's index files, in /pub/msdos/filedocs, are updated several
  2515.     times a month.  simlist.zip contains a list in text format.  But you
  2516.     may prefer the file simindex.zip, which is comma-delimited for easy
  2517.     use with any of these search facilities:
  2518.  
  2519.     - Two downloadable search programs are simtel35.zip and
  2520.       simdir22.zip.
  2521.  
  2522.     - dBASE III or IV users can load the index from simindex.zip using
  2523.       instructions in simibm.inf and simibm.db3.
  2524.  
  2525.     - PC-FILE users should get simibm.hdr, which tells how to use
  2526.       simibm.ibm.
  2527.  
  2528. Subject:  A06. How do I download and decode a program I found? (rev: 7
  2529.                Aug 1993)
  2530.  
  2531.     See the "Starter kit" and "Beginner's guide to binaries" in
  2532.     comp.binaries.ibm.pc, usually posted on the first and 15th of every
  2533.     month.  Please wait for these articles to come around; don't post a
  2534.     request.  If you can't wait, they are downloadable from
  2535.  
  2536.         Garbo as /pc/doc-net/starter.kit and bin.man
  2537.         rtfm.mit.edu in /pub/usenet/comp.binaries.ibm.pc .  The file
  2538.             names are quite long; try look for names of the form
  2539.             *starter.kit* and *bin.man*
  2540.  
  2541.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  2542.     archived?"
  2543.  
  2544.     Most binaries are posted and sent through email in 'uuencode'
  2545.     format.  The starter kit contains a uudecode program to turn this
  2546.     file back into binary.  Since the uuencoded file is bigger than the
  2547.     binary, you'll save connect time if you can uudecode it and then
  2548.     download the binary file.  Remember to set file type to binary.
  2549.  
  2550. Subject:  A07. Where is UUDECODE?
  2551.  
  2552.     You can find it at SimTel and Garbo, but it's easier to take it from
  2553.     the "starter kit" mentioned in the preceding Q.
  2554.  
  2555.     If you're logged in at a Unix site, there's almost certainly a
  2556.     uudecode there:  just type "uudecode" followed by a space and the
  2557.     file name.  The binary file is 25% smaller than the uuencoded file,
  2558.     so you'll save connect time if you can uudecode it on the Unix host
  2559.     and then download the binary file.  Remember: set file type binary.
  2560.  
  2561. Subject:  A08. Why do I get errors when extracting from a ZIP file I
  2562.                downloaded? (rev: 20 Mar 1994)
  2563.  
  2564.     There are many possible causes, but two of them probably account for
  2565.     95% of all problems.
  2566.  
  2567.     1) File transmission:  You must tell the archive site to transfer
  2568.     ZIP files in binary mode.  Depending on your software, you may also
  2569.     need to set your local software to receive files in binary mode.
  2570.  
  2571.     2) Unzipping program:  Make sure you aren't using an obsolete
  2572.     version.  In <9303290853.kp28285@tacom-emh1.army.mil> on 29 Mar
  2573.     1993, Keith Petersen, SimTel administrator, wrote:  "SIMTEL20 has
  2574.     standardized on the Info-ZIP group's ZIP and UNZIP because they are
  2575.     freely distributable and they have no restrictions on exporting.
  2576.     The latest version of Info-ZIP's ZIP and UNZIP can always be found
  2577.     in directory" /pub/msdos/zip "and will always have the name 'Info-
  2578.     ZIP' in the description to make them easy to locate."  PKUNZIP
  2579.     version 1.10 may not unzip newer stuff from archive sites because
  2580.     site administrators have now embraced version 2.04.  Also see "B03.
  2581.     What's the current version of UNZIP?"
  2582.  
  2583.  
  2584. section B. Vendors and products
  2585. ===============================
  2586.  
  2587. Subject:  B01. How can I contact Borland? (rev: 6 Sep 1993)
  2588.  
  2589.     Borland has set up these email addresses.  However, none of them is
  2590.     for technical support such as help with finding your own programming
  2591.     errors and explaining compiler messages.
  2592.  
  2593.     - bp7-info@borland.com will reply to any message with 17K of info on
  2594.       Borland Pascal with Objects 7.0 and Turbo Pascal 7.0.
  2595.  
  2596.     - customer-support@borland.com is for questions about prices and
  2597.       features of products, replacing bad or missing disks, info on
  2598.       upgrades, etc.  They do not accept emailed credit-card numbers.
  2599.  
  2600.     - bugs@borland.com will take "a well-documented bug report" and send
  2601.       an automated response, but will not give you a workaround or a
  2602.       scheduled fix date or even confirm that it is or is not considered
  2603.       a bug.  "The purpose of bugs@borland.com is to improve future
  2604.       products sooner, not as a substitute for tech support channels."
  2605.  
  2606.     Email tech support is available only through Compuserve (GO BOR).
  2607.  
  2608.     Telephone support is provided through separate phone numbers for
  2609.     most products.  If you're calling from the U.S., dial (800) 841-8180
  2610.     for a recorded list of toll numbers to call.  Borland's BBS is at +1
  2611.     408 439 9096.  The surface-mail address is Technical Support
  2612.     Department, Borland International, P.O. Box 660001, Scotts Valley CA
  2613.     95067-0001, USA.
  2614.  
  2615.     You'll need to give your product's name, version, and serial number.
  2616.  
  2617.     Patches for Borland products are archived at ftp.cica.indiana.edu in
  2618.     directory /pub/pc/borland .  (I haven't verified this personally.)
  2619.  
  2620.     Borland's TechFax documents are also available for download:
  2621.  
  2622.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  2623.         /pc/turbopas/bchelp10.zip at Garbo.
  2624.  
  2625.     These documents are detailed answers to common questions about Turbo
  2626.     C and Borland C products, and aggregate several hundred Kbytes.
  2627.  
  2628. Subject:  B02. How can I contact Microsoft? (rev: 18 Sep 1993)
  2629.  
  2630.     Individual employees of Microsoft (not MicroSoft, please!) post here
  2631.     sometimes.  Their addresses all take the form person@microsoft.com.
  2632.     However, Microsoft as a company does not answer individual questions
  2633.     via email through the Internet.
  2634.  
  2635.     1) information available via anonymous ftp
  2636.  
  2637.     The company maintains an anonymous FTP server, ftp.microsoft.com.
  2638.     Effective 1 Oct 1993 the server will support "Microsoft development
  2639.     tools and advanced systems products, including Windows NT, the Win32
  2640.     SDX, the Windows 3.1 SDK, Visual C++, Visual Basic, LAN Manager, SQL
  2641.     Server, and others," according to {Microsoft Developer News} for
  2642.     September 1993.  The server contains "the complete Developer
  2643.     Knowledge Base with articles written and used by Microsoft Support
  2644.     Engineers.  You will also find device drivers, patches, code
  2645.     samples, help files, and white papers."  Readme files will "give an
  2646.     overview of the directory structure," which appears to be different
  2647.     from what was put in place in July 1993.  For further information,
  2648.     says Microsoft, call (800) 936-5300.
  2649.  
  2650.     "Microsoft Developer Network technical articles and selected sample
  2651.     code files are available ... at ftp.uu.net ... in the subdirectory
  2652.     ~ftp/vendor/microsoft/developer-network" according to {Microsoft
  2653.     Developer News} for September 1993.
  2654.  
  2655.     2) information via U.S. Mail
  2656.  
  2657.     Microsoft Product Support is at 16011 NE 36th Way, Box 97017,
  2658.     Redmond WA 98073-9717, USA.
  2659.  
  2660.     You can subscribe to the {Microsoft Developer News} by mailing a
  2661.     request to Microsoft Developer Network, P.O. Box 51812, Boulder CO
  2662.     80322-1812, U.S.A.  The nearest I can figure, this is free;
  2663.     certainly I've never paid for it or been asked to.
  2664.  
  2665.     3) tech support via modem
  2666.  
  2667.     On Compuserve, GO MICROSOFT; or call Microsoft's BBS at +1 206 936-
  2668.     6735 in the U.S., or +1 416 507-3022 in Canada.
  2669.  
  2670.     4) tech support via voice telephone lines
  2671.  
  2672.     If you want to place an order or get general pre-sales information,
  2673.     call the appropriate sales and service number:
  2674.  
  2675.         U.S. end-user sales                   (800) 426-9400
  2676.         U.S. corporate/gov't/reseller/
  2677.                  educational sales            (800) 227-4679
  2678.         Canadian sales                        (800) 568-3503
  2679.         International sales                  +1 206 936-8661
  2680.  
  2681.     For tech support you must make an ordinary long-distance phone call.
  2682.     Microsoft has separate incoming phone numbers for many products.
  2683.     Since it's your nickel, first check your documentation to see if a
  2684.     phone number is listed.  Here are phone numbers (as of 1 June 1992)
  2685.     for a few products of most interest to the readers of this group:
  2686.  
  2687.         C/C++               (206) 635-7007
  2688.         MASM                (206) 646-5109
  2689.         DOS Upgrade Users   (206) 646-5104 (for 90 days after first
  2690.             call)
  2691.         Windows Users       (206) 637-6098
  2692.  
  2693.     If you can't find the direct number any other way, call the "master"
  2694.     numbers below or the sales numbers a few paragraphs above.  You'll
  2695.     get the "voice mail phone tree from h-ll" but you'll eventually get
  2696.     to the right department.  They don't provide technical assistance,
  2697.     but a voice menu will help you find the current phone number for the
  2698.     department you need.
  2699.  
  2700.         U.S. end-user product support         (206) 454-2030
  2701.         U.S. languages support                (206) 637-7096
  2702.  
  2703. Subject:  B03. What's the current version of UNZIP? (rev: 17 Mar 1994)
  2704.  
  2705.     Since April 1993, the administrators of Garbo and SimTel have
  2706.     accepted uploads in the ZIP 2.0 format.  You can use the free Info-
  2707.     ZIP versions, or PKZIP 2.04g (not 2.04c or 2.04e).  SimTel has
  2708.     standardized on the Info-ZIP versions for several reasons, as
  2709.     explained in an article posted 29 Mar 1993 in
  2710.     comp.archives.msdos.announce.
  2711.  
  2712.     Info-ZIP versions ZIP 2.0 and UNZIP 5.1 are now current.  Those
  2713.     programs, ZIP 1.9, UNZIP 5.0, and PKZIP 2.04g all work with the same
  2714.     file formats.
  2715.  
  2716.     The primary source of the free Info-ZIP programs is at ftp.uu.net,
  2717.     directory /pub/archiving/zip; or at quest.jpl.nasa.gov, directory
  2718.     /pub.  Files are in those directories or in subdirectories as shown
  2719.     below.  The DOS executable for UNZIP is self extracting; all others
  2720.     require UNZIP 5.0 or 5.1:
  2721.  
  2722.         MSDOS/unzip51x.exe - DOS executable and doc, UNZIP 5.1
  2723.         unzip51.zip - source code for UNZIP 5.1, all platforms
  2724.         MSDOS/zip20x.zip - DOS exe and doc, ZIP without crypt support
  2725.         zip201.zip - source code for ZIP 2.0, all platforms
  2726.         MSDOS/zcryp20x.zip - DOS exe and doc, ZIP with crypt support
  2727.         zcrypt21.zip - source code for ZIP crypt support
  2728.         WINDOWS/wunz20x.zip - Windows 3.1 WIZUNZIP 2.0 exe and help file
  2729.         WINDOWS/wunz20sr.zip - Windows 3.1 WIZUNZIP 2.0 source
  2730.  
  2731.     The essential files are also available at SimTel in /pub/msdos/zip
  2732.     and at Garbo in /pc/arcers.
  2733.  
  2734.     PKZIP and PKUNZIP are shareware products of PKWARE Inc.  The current
  2735.     version is 2.04g, which is the third official version after 1.10.
  2736.     They are downloadable
  2737.  
  2738.         from PKWARE's bulletin board, +1 414 354 8670, or
  2739.         from Garbo as /pc/arcers/pkz204g.exe
  2740.         from SimTel as /pub/msdos/zip/pkz204g.exe
  2741.  
  2742.     By the way, if you want to develop your own utilities, you will find
  2743.     the ZIP 2.0 data structures described in the downloadable file
  2744.  
  2745.         /pub/msdos/zip/appnote.zip at SimTel.
  2746.  
  2747. Subject:  B04. What is the phone number for a vendor's BBS? (rev: 24 Mar
  2748.                1994)
  2749.  
  2750.     Robert Baker (rbakerpc@delphi.com) uploaded a list of 800 bulletin-
  2751.     board support numbers operated by software vendors as of August
  2752.     1993.  It is downloadable as /pub/msdos/bbslist/bbs_9308.zip from
  2753.     SimTel.
  2754.  
  2755.  
  2756. section C. More information
  2757. ===========================
  2758.  
  2759. Subject:  C01. Are there any good on-line references for PC hardware
  2760.                components? (rev: 28 July 1993)
  2761.  
  2762.     Good reports of HELPPC21 have been posted.  It is downloadable as
  2763.  
  2764.         /pub/msdos/info/helppc21.zip at SimTel
  2765.         /pc/programming/helppc21.zip at Garbo.
  2766.  
  2767.     This hypertext system contains much information on ports and other
  2768.     hardware, as well as some overlap with Ralf Brown's interrupt list
  2769.     (Q C03).  It is shareware ($25).
  2770.  
  2771. Subject:  C02. Are there any good on-line references for PC interrupts?
  2772.  
  2773.     The definitive work is Ralf Brown's interrupt list; see Q C03.
  2774.  
  2775. Subject:  C03. What and where is "Ralf Brown's interrupt list"? (rev: 6
  2776.                Jun 1994)
  2777.  
  2778.     This is megabytes of information on documented and (officially)
  2779.     undocumented BIOS and DOS interrupts, DOS tables, and interrupts
  2780.     hooked by many software packages.
  2781.  
  2782.     The interrupt list comes from cs.cmu.edu [128.2.222.173] in
  2783.     /afs/cs/user/ralf/pub (switch there with a single command) as
  2784.     inter41a.zip, inter41b.zip, and inter41c.zip; the separate file
  2785.     inter41d.zip contains utilities.  The list is also downloadable as
  2786.  
  2787.         /pub/msdos/info/inter41.zip from SimTel
  2788.         /pc/programming/inter41.zip from Garbo.
  2789.  
  2790.     These versions were uploaded in early June 1994; updates are
  2791.     announced every few months in comp.archives.msdos.announce.
  2792.  
  2793. Subject:  C04. Where can I find lex, yacc, and language grammars?
  2794.  
  2795.     The FAQ list of the comp.compilers newsgroup answers this for Basic,
  2796.     C, Pascal, and other languages.  See "C06. Where are FAQ lists
  2797.     archived?"
  2798.  
  2799. Subject:  C05. What's the best book to learn programming?
  2800.  
  2801.     Sorry, this FAQ list cannot settle religious arguments.
  2802.  
  2803.     Much of the heat over this topic arises because each person believes
  2804.     that the book that he or she learned from is the best book.  But
  2805.     different people have very different experiences of the same book.
  2806.     The only person who can tell you which is the best book for learning
  2807.     a given topic is you.
  2808.  
  2809.     Your best bet is to go to a fairly well-stocked bookstore when you
  2810.     have a couple of hours to spare.  Start at one end of the shelf and
  2811.     work your way methodically through every book that looks like it
  2812.     might cover what you want to learn.  Look at the tables of contents;
  2813.     read a page or two from each book.  Then make your decision.  If
  2814.     money is a problem, or if you're not sure of your choice, check out
  2815.     your top two or three from your library.
  2816.  
  2817. Subject:  C06. Where are FAQ lists archived? (rev: 29 Mar 1994)
  2818.  
  2819.     Very possibly the FAQ list you want is already at your site.  Check
  2820.     the newsgroup news.answers; if your site doesn't carry news.answers,
  2821.     check comp.answers, rec.answers, etc., according to the top-level
  2822.     name in the FAQ list's "home" newsgroup.  Articles are posted to the
  2823.     *.answers groups in a way that should make them last until the next
  2824.     versions are posted.  If they expire sooner at your site, you might
  2825.     want to lobby your sysadmin to treat the moderated *.answers groups
  2826.     as a special case and grant them longer expiration times than other
  2827.     groups.
  2828.  
  2829.     To ftp most FAQ lists, connect to rtfm.mit.edu, and change to
  2830.     directory /pub/usenet/news.answers.  The name of the file that you
  2831.     want is the Archive-name from the top of the article.  For instance,
  2832.     if the Archive-name is software-eng/part1 you would retrieve
  2833.     /pub/usenet/news.answers/software-eng/part1.
  2834.  
  2835.     By email (only if you have no ftp access, please), the server is
  2836.     mail-server@rtfm.mit.edu .  It accepts "send" commands that omit the
  2837.     leading "/pub/" from file names; for example:
  2838.  
  2839.         send usenet/news.answers/software-eng/part1
  2840.  
  2841.     For full instructions about the mail server, send it a message
  2842.     consisting of these two lines:
  2843.  
  2844.         help
  2845.         index
  2846.  
  2847.     Not just FAQ lists, but every article listed in the "List of
  2848.     Periodic Informational Postings" (LoPIP) can be obtained by ftp or
  2849.     email from rtfm.mit.edu.  If you have an old copy of an
  2850.     informational article, look for an "Archive-name" at the beginning;
  2851.     rtfm.mit.edu stores it under that name in /pub/usenet/news.answers.
  2852.     If the article has no Archive-name, check the first name on the
  2853.     Newsgroups line and change to that directory under /pub/usenet.
  2854.  
  2855.     Or send email >>> with valid reply-to address << to brown@ncoast.org
  2856.     and you'll receive my canned instructions (about 8K) for retrieving
  2857.     FAQ lists for most newsgroups, including a few that aren't archived
  2858.     at rtfm.mit.edu.  (This offer may be withdrawn without notice
  2859.     depending on system constraints.)
  2860.  
  2861. Subject:  C07. Where can I get the latest copy of this FAQ list? (rev:
  2862.                30 Mar 1994)
  2863.  
  2864.     You can retrieve the latest version of this list as
  2865.  
  2866.         /pub/msdos/info/faqp*.zip from SimTel
  2867.         /pc/doc-net/faqp*.zip from Garbo.
  2868.  
  2869.     Check the date before downloading, to make sure that the archived
  2870.     version is actually newer than what you have.
  2871.  
  2872.     Like most FAQ lists, this one is archived at rtfm.mit.edu and a
  2873.     number of mirror sites.  If you have ftp access, retrieve either of
  2874.     these identical files:
  2875.  
  2876.         /pub/usenet/news.answers/msdos-programmer-faq/faq
  2877.         /pub/usenet/comp.os.msdos.programmer/dos-faq
  2878.  
  2879.     If you have no ftp access, see "C06. Where are FAQ lists archived?"
  2880.     for instructions on retrieving it by email.
  2881.  
  2882. Subject:  C08. How do I use ftp? (rev: 6 Apr 1994)
  2883.  
  2884.     I was much impressed with {The Whole Internet User's Guide and
  2885.     Catalog} by Ed Krol (O'Reilly & Associates, second edition ISBN
  2886.     1-56592-063-5).  It gives lots of information on using ftp, email,
  2887.     Telnet, Archie, etc.  As a new user of ftp (January 1993), I found
  2888.     the information made me productive quickly.  (Disclosure:  Though I
  2889.     don't believe it has biased my judgment, you should know that
  2890.     O'Reilly sent me a free evaluation copy.)
  2891.  
  2892.     You may also want to look for the "Beginner's Guide to FTP", posted
  2893.     periodically in comp.binaries.ibm.pc.  You can retrieve it from
  2894.     rtfm.mit.edu (see "C06. Where are FAQ lists archived?"), in
  2895.     /pub/usenet/comp.binaries.ibm.pc, as *ftp.man*.
  2896.  
  2897.     When downloading a file by ftp, make sure you have write access to
  2898.     your working directory on your local machine, and that your disk has
  2899.     enough space to hold the files.  Also make sure that if it's a ZIP
  2900.     file or other binary file type, you set the protocol to binary
  2901.     before downloading the file.
  2902.  
  2903. (end of comp.os.msdos.programmer FAQ)
  2904. -- 
  2905. Stan Brown, Oak Road Systems                    brown@Ncoast.ORG
  2906. Can't find FAQ lists?  ftp to 'rtfm.mit.edu' and look in /pub/usenet
  2907. (or email me >>> with valid reply-to address <<< for instructions).
  2908. I can also send "newbie" information on Usenet--just ask if you want it.
  2909.  
  2910.